From f61e6c4ec5e5b002c62d06611909b2f80f6a2a37 Mon Sep 17 00:00:00 2001 From: Ned Ludd Date: Thu, 25 Jan 2007 15:38:57 +0000 Subject: [PATCH] - version bump. Includes changes from psm to make paxtest a bit more portable Package-Manager: portage-2.1.2_rc2-r4 --- app-admin/paxtest/ChangeLog | 10 +- app-admin/paxtest/Manifest | 20 +- app-admin/paxtest/files/Makefile.psm5 | 207 ++++++++++++++++++ .../paxtest/files/digest-paxtest-0.9.7_pre4 | 3 + app-admin/paxtest/paxtest-0.9.7_pre4.ebuild | 42 ++++ 5 files changed, 276 insertions(+), 6 deletions(-) create mode 100644 app-admin/paxtest/files/Makefile.psm5 create mode 100644 app-admin/paxtest/files/digest-paxtest-0.9.7_pre4 create mode 100644 app-admin/paxtest/paxtest-0.9.7_pre4.ebuild diff --git a/app-admin/paxtest/ChangeLog b/app-admin/paxtest/ChangeLog index aaa27d257436..35ad8e26db66 100644 --- a/app-admin/paxtest/ChangeLog +++ b/app-admin/paxtest/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-admin/paxtest -# Copyright 2000-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/paxtest/ChangeLog,v 1.26 2006/09/08 05:51:14 corsair Exp $ +# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/paxtest/ChangeLog,v 1.27 2007/01/25 15:38:57 solar Exp $ + +*paxtest-0.9.7_pre4 (23 Jan 2007) + + 23 Jan 2007; +files/Makefile.psm5, + +paxtest-0.9.7_pre4.ebuild: + - version bump. Includes changes from psm to make paxtest a bit more portable 08 Sep 2006; Markus Rothe paxtest-0.9.6.ebuild: Back to ~ppc64 diff --git a/app-admin/paxtest/Manifest b/app-admin/paxtest/Manifest index 0cc74f284365..d38887794498 100644 --- a/app-admin/paxtest/Manifest +++ b/app-admin/paxtest/Manifest @@ -2,6 +2,10 @@ AUX Makefile-portable 7373 RMD160 44309d63d083a166587861d4a7c8d891fe8dd68a SHA1 MD5 72e240fcd006ff512fa354491c0ed637 files/Makefile-portable 7373 RMD160 44309d63d083a166587861d4a7c8d891fe8dd68a files/Makefile-portable 7373 SHA256 7a033aa44bcea376a0ff4fa267d13920d951b0a9d3eda14b1f531c7143c27303 files/Makefile-portable 7373 +AUX Makefile.psm5 6157 RMD160 5f71e78ee5adcc2e072548fa11ec554480004d66 SHA1 22a13a91e2eb06896fc1019efc0dbc94b5047b11 SHA256 a0909073b620b48556139c5aa6fa311d2144fde93cd3bc64d172c1dfd00021f9 +MD5 aee53f87e2e4a403d1cb6f9ed20249c8 files/Makefile.psm5 6157 +RMD160 5f71e78ee5adcc2e072548fa11ec554480004d66 files/Makefile.psm5 6157 +SHA256 a0909073b620b48556139c5aa6fa311d2144fde93cd3bc64d172c1dfd00021f9 files/Makefile.psm5 6157 AUX paxtest-0.9.5-use-fPIE.patch 813 RMD160 86f9d9456dbedde81853302f28bbe212aa8418ea SHA1 78e16661716988899cb2a1ba3b697a1fc07d099f SHA256 585f2d34cd438a3b9b3f05868f8a6e7a72af009c35e74feed4e33294a13fd2c6 MD5 30e5dbdc3446194bf75504fe4c83d5d9 files/paxtest-0.9.5-use-fPIE.patch 813 RMD160 86f9d9456dbedde81853302f28bbe212aa8418ea files/paxtest-0.9.5-use-fPIE.patch 813 @@ -12,6 +16,7 @@ RMD160 7601b098ae29afb27de7d3460d777fb13c6d4824 files/paxtest-0.9.5.1.diff 2369 SHA256 9b9ccde9603017be034d6ee3b63daa2ff7b2af5ba3b789429a58948bedf20a95 files/paxtest-0.9.5.1.diff 2369 DIST paxtest-0.9.5.tar.gz 26961 DIST paxtest-0.9.6.tar.gz 35747 RMD160 a19ef178bf11d2e3a007e6958f4e371ce941b97c SHA1 591065b15431d5b34a98a2e8946ff3cd09bbd0ff SHA256 d79bed06edbb28e3c69bba653a216cea3ed3f1704aeefe1565eddcbae8cd49b5 +DIST paxtest-0.9.7-pre4.tar.gz 34552 RMD160 dab85b408f0efc7c3de39563fda852be23771427 SHA1 edd55c07fbdbff862e531caa003fe8661425d0c9 SHA256 033c60eeed8e7ddf877b60e239f5b79c76874f53c3b656c16ed0e02893d014b5 EBUILD paxtest-0.9.5-r1.ebuild 1089 RMD160 c1c6a4e3657fcfc81588806bfe3884bd3788178c SHA1 971002267a1199b58d6289219b3e099f6c0f7b63 SHA256 9e854eeea4b2efb43fea78c9d156e39168feb2c7614584fc5d679e62698c5556 MD5 45b4d7ef46e496dc198373339532418b paxtest-0.9.5-r1.ebuild 1089 RMD160 c1c6a4e3657fcfc81588806bfe3884bd3788178c paxtest-0.9.5-r1.ebuild 1089 @@ -20,10 +25,14 @@ EBUILD paxtest-0.9.6.ebuild 950 RMD160 e946906a483c79871a43b687738810e177294c02 MD5 dfdc97397c033f91abfd4003963171fb paxtest-0.9.6.ebuild 950 RMD160 e946906a483c79871a43b687738810e177294c02 paxtest-0.9.6.ebuild 950 SHA256 512175f795e85eb367a3822fd65b157459a4ff168598c7223566854d7eb79045 paxtest-0.9.6.ebuild 950 -MISC ChangeLog 3411 RMD160 d6de4c047839be59a9ad42dc955b5cb77de5ebee SHA1 038b7abd03972768c29b12013d75d023e3ba03c2 SHA256 e3b67cf2d2935b74c5574725841717093a0e382384f7c562d6eb8295c4cc2ba9 -MD5 91933baaa3289c5a234a512ebcd2bcae ChangeLog 3411 -RMD160 d6de4c047839be59a9ad42dc955b5cb77de5ebee ChangeLog 3411 -SHA256 e3b67cf2d2935b74c5574725841717093a0e382384f7c562d6eb8295c4cc2ba9 ChangeLog 3411 +EBUILD paxtest-0.9.7_pre4.ebuild 1115 RMD160 f31a976e19e834b6a11d23d0d1e7470140d3f0c2 SHA1 998120cfbbaeadb93c99063c8b67269f914c42db SHA256 a5ec665ad1bd16846f3c8ecbf0bdb8176bcd8b2ebec4dccf5905ba324934e665 +MD5 c347d4096f93cc50b2d81d114f8defd7 paxtest-0.9.7_pre4.ebuild 1115 +RMD160 f31a976e19e834b6a11d23d0d1e7470140d3f0c2 paxtest-0.9.7_pre4.ebuild 1115 +SHA256 a5ec665ad1bd16846f3c8ecbf0bdb8176bcd8b2ebec4dccf5905ba324934e665 paxtest-0.9.7_pre4.ebuild 1115 +MISC ChangeLog 3611 RMD160 9b0db6b035815b3c0f4edffb359ba842cfc6206c SHA1 5706fb05e10a7d573ecfd37c79083a943649eda4 SHA256 1c7f323c2ddd7dc81cb9baba8e67825508bdd9eae33d2c60f8ab1e3180c3b195 +MD5 ae85ad32f9bcf98af666190528264e87 ChangeLog 3611 +RMD160 9b0db6b035815b3c0f4edffb359ba842cfc6206c ChangeLog 3611 +SHA256 1c7f323c2ddd7dc81cb9baba8e67825508bdd9eae33d2c60f8ab1e3180c3b195 ChangeLog 3611 MISC metadata.xml 1075 RMD160 8e3cfd11e2a8fa1334390dd6503ba82a32a08fb8 SHA1 b12c5c2530c840f69ce3b3a1d267bd195a107b35 SHA256 92a9af0326aa50db1957e3a9088da6c416a26e82f1208ff2c8f94be40ed41f46 MD5 9c3ac1379620120fbd744ce753b30ab5 metadata.xml 1075 RMD160 8e3cfd11e2a8fa1334390dd6503ba82a32a08fb8 metadata.xml 1075 @@ -34,3 +43,6 @@ SHA256 517d3933b4cd95fbfd5078aa7bc34f91c25482dab1bfa4e9b0283617397f0773 files/di MD5 b90ffd285c0b772790b4904be8bfb3e6 files/digest-paxtest-0.9.6 238 RMD160 70ba45b44146c7c68cc25c4568c5ef13c39cdf4d files/digest-paxtest-0.9.6 238 SHA256 39b65995aa7b3af9ea9b874bf86962aebbda2a3a66937c959cb7de611ce3d58e files/digest-paxtest-0.9.6 238 +MD5 7dae504403d219baf7d71da16abd1a49 files/digest-paxtest-0.9.7_pre4 253 +RMD160 41d6e40250f654b2ff4ddf2e9917db5b8b2d7f34 files/digest-paxtest-0.9.7_pre4 253 +SHA256 b1c6a365c14777cae56200dedd1f3f37f4aa6fd9181fd96fe96d8e76eb7e3645 files/digest-paxtest-0.9.7_pre4 253 diff --git a/app-admin/paxtest/files/Makefile.psm5 b/app-admin/paxtest/files/Makefile.psm5 new file mode 100644 index 000000000000..54c94480c1c3 --- /dev/null +++ b/app-admin/paxtest/files/Makefile.psm5 @@ -0,0 +1,207 @@ +#!/usr/bin/make + +# tested with make-3.79.1/gcc-2.96 (shared) and make-3.80/gcc-3.3.2/3 (pie) +# make-3.79.1 does not support $$@ as target requirement (works for make-3.80) + +# preliminaries: +# Gentoo modifies the specs adding pie/nopie to enable/disable ET_DYN binaries + +CC := gcc +LD := ld +CC_PIC := -fPIC +GCC_SPCS := $(shell $(CC) -print-file-name=${GCC_SPECS:-specs}) + +check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \ + then echo "$(1)"; else echo "$(2)"; fi) + +check_as = $(shell if $(CC) -Wa,$(1) -Wa,-Z -c -o /dev/null -xassembler /dev/null > /dev/null 2>&1; \ + then echo "-Wa,$(1)"; fi) + +# stack protector has to be disabled for some tests +CC_SSP := $(call check_gcc,-fno-stack-protector,) +CC_SSP += $(call check_gcc,-fno-stack-protector-all,) + +ASFLAGS := $(call check_as,--noexecstack) + +CC_PIE := $(call check_gcc,-fPIE,-fPIC) + +SCRT_FILE = $(shell if test -r /usr/lib/Scrt1.o ; then echo "/usr/lib/Scrt1.o"; fi) + +ifneq ($(SCRT_FILE),) +LD_PIE = $(shell $(LD) --help | grep -q pie && echo "-Wl,-pie") +ifneq ($(LD_PIE),) +# Gentoo (hardened specs enabled) +CC_ETEXEC = $(shell grep -q "\!nopie" $(GCC_SPCS) && echo "-nopie") +LD_ETEXEC = $(CC_ETEXEC) +endif +else +# generic, local version +SCRT_FILE = crt1S.o +endif + +ifeq ($(LD_PIE),) +LD_PIE = -shared +PAX_DEP = $(SCRT_FILE) interp.o +endif + +# check for installed binaries +CHPAXBIN := $(shell if which chpax >/dev/null 2>&1 ; then echo chpax; fi) +PAXCTLBIN := $(shell if which paxctl >/dev/null 2>&1 ; then echo paxctl; fi) +# should somehow use this to see if we really need paxctl +# list=`paxctl -qQv /sbin/paxctl 2>/dev/null`; if echo $list | grep -q "PaX flags" ; then echo paxctl; fi +# instead we use both markings to have paxtest running correctly on all platforms + +ifneq ($(PAXCTLBIN),) +DUMMY := $(shell echo '${PAXCTLBIN} $$*' > paxbin) +endif + +# for some reason the .c files need it, else GNU_STACK=RWE +OPT_FLAGS := -O2 $(ASFLAGS) +PTHREAD := -lpthread +# define stripping of binaries/libs here, or set these on make's commandline, +# else you'll loose the chpax flags! +LDFLAGS := +SHLDFLAGS := +ifndef RUNDIR +RUNDIR := . +endif + +# The Hardened GCC compiler has stack protector on by default, this +# could interfere with the results of this test. + +CFLAGS := $(OPT_FLAGS) -DRUNDIR=\"${RUNDIR}\" $(CC_SSP) + +EXEC_TESTS = anonmap execbss execdata execheap execstack +MPROT_TESTS = mprotanon mprotbss mprotdata mprotheap mprotstack +MPROTSH_TESTS = mprotshbss mprotshdata writetext +RAND_TESTS = randamap randheap1 randheap2 randmain1 randmain2 randshlib randstack1 randstack2 +RET_TESTS = rettofunc1 rettofunc2 +RETX_TESTS = rettofunc1x rettofunc2x +SHLIB_TESTS = shlibbss shlibdata + +TESTS = $(EXEC_TESTS) $(MPROT_TESTS) $(MPROTSH_TESTS) $(RAND_TESTS) $(RET_TESTS) $(RETX_TESTS) $(SHLIB_TESTS) + +UTILS= getamap getheap1 getheap2 getmain1 getmain2 getshlib getstack1 getstack2 + +SHLIBS= shlibtest.so shlibtest2.so + +ifeq ($(CHPAXBIN),) +CHPAXVER := 0.7 +CHPAX := chpax-$(CHPAXVER) +CHPAXSRC := $(CHPAX)/aout.c $(CHPAX)/chpax.c $(CHPAX)/elf32.c $(CHPAX)/elf64.c $(CHPAX)/flags.c $(CHPAX)/io.c +CHPAXBIN := ./chpax +all: chpax $(SHLIBS) $(TESTS) $(UTILS) paxtest +else +all: $(SHLIBS) $(TESTS) $(UTILS) paxtest +endif + +# we need the failure handling, for kernels not supporting EI_PAX +DUMMY := $(shell echo '${CHPAXBIN} $$* 2>/dev/null ||:' >> paxbin; chmod +x paxbin) + +PAXBIN := ./paxbin +DL := -ldl + +clean: + -rm -f *.o *.s *~ core + -rm -f $(TESTS) $(UTILS) $(SHLIBS) + -rm -f paxtest paxtest.log a.out dumpspecs paxbin + +ifdef DESTDIR +ifdef BINDIR +ifdef RUNDIR +install: all + mkdir -p $(DESTDIR)/$(RUNDIR) + cp $(SHLIBS) $(TESTS) $(UTILS) $(DESTDIR)/$(RUNDIR) + mkdir -p $(DESTDIR)/$(BINDIR) + cp paxtest $(DESTDIR)/$(BINDIR) + chmod 755 $(DESTDIR)/$(BINDIR)/paxtest +endif +endif +endif + +chpax: $(CHPAXSRC:.c=.o) + $(CC) $(LDFLAGS) -o $@ $^ + +paxtest: $(TESTS) genpaxtest + sh genpaxtest $(TESTS) + +.S.o: + $(CC) $(CFLAGS) $(CC_PIE) $(ASFLAGS) -o $@ -c $< +.c.o: + $(CC) $(CFLAGS) -o $@ -c $< + +$(EXEC_TESTS) $(MPROT_TESTS): body.o + $(CC) $(CFLAGS) -o $@.o -c $@.c + $(CC) $(LDFLAGS) $(PTHREAD) -o $@ $< $@.o + +$(RAND_TESTS): randbody.o + $(CC) $(CFLAGS) -o $@.o -c $@.c + $(CC) $(LDFLAGS) -o $@ $< $@.o + +getamap: getamap.o + $(CC) $(LDFLAGS) -o $@ $@.o + +# get heap1/main1 are built w/o PIC +get%1.o: get%.c + $(CC) $(CFLAGS) $(CC_ETEXEC) -o $@ -c $< + +# get heap2/main2 are built w/ PIC +get%2.o: get%.c + $(CC) $(CFLAGS) $(CC_PIE) -o $@ -c $< + +# Adamantix uses the PIC version (getheap2.o), not necessary for ET_EXEC +# build as ET_EXEC (not in Adamantix's Makefile) +getheap1: getheap1.o + $(CC) $(LDFLAGS) $(LD_ETEXEC) -o $@ $< + +getmain1: getmain1.o + $(CC) $(LDFLAGS) $(LD_ETEXEC) -o $@ $< + $(PAXBIN) -SPRXM $@ + +getheap2 getmain2: $(PAX_DEP) getheap2.o getmain2.o + $(CC) $(LDFLAGS) $(LD_PIE) -o $@ $(PAX_DEP) $@.o || (echo -e "#!/bin/sh\necho $@ pie not implemented" > $@; chmod +x $@) + +getshlib: getshlib.o + $(CC) $(LDFLAGS) -o $@ $< $(DL) + +# ET_EXEC and usage of "m" is not confirmed (as in Gentoo patch) +# Adamantix does not use it +# Pax Team does not want "m" for getstack1/2 +getstack1: getstack.o + $(CC) $(LDFLAGS) -o $@ $< + $(PAXBIN) -SRp $@ + +getstack2: getstack.o + $(CC) $(LDFLAGS) -o $@ $< + # disable segmexec, kernel else overrides pageexec + $(PAXBIN) -PRs $@ + +$(MPROTSH_TESTS): body.o shlibtest.so + $(CC) $(CFLAGS) -o $@.o -c $@.c + $(CC) $(LDFLAGS) $(PTHREAD) -o $@ $@.o $^ + +# used for RANDEXEC'd binaries +retbody.o: body.c + $(CC) $(CFLAGS) $(CC_ETEXEC) -o $@ -c $< + +# build as ET_EXEC (recommended by PaX Team, not really a requirement) +$(RET_TESTS): retbody.o + $(CC) $(CFLAGS) $(CC_ETEXEC) -o $@.o -c $@.c + $(CC) $(LDFLAGS) $(LD_ETEXEC) $(PTHREAD) -o $@ $< $@.o + +# build as ET_EXEC (not in Adamantix's Makefile) +$(RETX_TESTS): retbody.o + $(CC) $(CFLAGS) $(CC_ETEXEC) -o $@.o -c $@.c + $(CC) $(LDFLAGS) $(LD_ETEXEC) $(PTHREAD) -o $@ $< $@.o + $(PAXBIN) -SPXM $@ + +# should also shlibbss.o and shlibdata.o be built w/ PIC? +# if yes, remove tes from target and dependency +shlibtes%.o: shlibtes%.c + $(CC) $(CFLAGS) $(CC_PIC) -o $@ -c $< + +shlib%.so: shlib%.o + $(CC) $(SHLDFLAGS) -shared -o $@ $< + +$(SHLIB_TESTS): body.o $(SHLIBS) shlibbss.o shlibdata.o + $(CC) $(LDFLAGS) $(PTHREAD) -o $@ body.o $@.o $(SHLIBS) $(DL) diff --git a/app-admin/paxtest/files/digest-paxtest-0.9.7_pre4 b/app-admin/paxtest/files/digest-paxtest-0.9.7_pre4 new file mode 100644 index 000000000000..acadd9d3e3b5 --- /dev/null +++ b/app-admin/paxtest/files/digest-paxtest-0.9.7_pre4 @@ -0,0 +1,3 @@ +MD5 28469813c9b797e85afc766190630132 paxtest-0.9.7-pre4.tar.gz 34552 +RMD160 dab85b408f0efc7c3de39563fda852be23771427 paxtest-0.9.7-pre4.tar.gz 34552 +SHA256 033c60eeed8e7ddf877b60e239f5b79c76874f53c3b656c16ed0e02893d014b5 paxtest-0.9.7-pre4.tar.gz 34552 diff --git a/app-admin/paxtest/paxtest-0.9.7_pre4.ebuild b/app-admin/paxtest/paxtest-0.9.7_pre4.ebuild new file mode 100644 index 000000000000..50edad70c58f --- /dev/null +++ b/app-admin/paxtest/paxtest-0.9.7_pre4.ebuild @@ -0,0 +1,42 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/paxtest/paxtest-0.9.7_pre4.ebuild,v 1.1 2007/01/25 15:38:57 solar Exp $ + +inherit eutils multilib + +MY_P=${P/_/-} +DESCRIPTION="PaX regression test suite" +HOMEPAGE="http://www.adamantix.org/paxtest/" +#SRC_URI="http://www.adamantix.org/paxtest/${MY_P}.tar.gz" +SRC_URI="http://pax.grsecurity.net/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" +IUSE="" +# EI_PAX flags are not strip safe. +RESTRICT="nostrip" +S=${WORKDIR}/${MY_P} + +RDEPEND="" +DEPEND="${RDEPEND} + >=sys-apps/chpax-0.7 + sys-apps/paxctl" + +src_unpack() { + unpack ${A} + cd ${S} + cp ${FILESDIR}/Makefile.psm5 ${S}/Makefile || die + sed -i 's:-O2:${CFLAGS}:' ${S}/Makefile +} + +src_compile() { + emake DESTDIR=${D} BINDIR=${D}/usr/bin RUNDIR=/usr/$(get_libdir)/paxtest || die +} + +src_install() { + make DESTDIR="${D}" BINDIR=/usr/bin RUNDIR=/usr/$(get_libdir)/paxtest install || die + for doc in Changelog README ; do + [[ -f ${doc} ]] && dodoc ${doc} + done +} -- 2.26.2