pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

paxtest: add tool for testing pax functionality



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <wiz%NetBSD.org@localhost>
Pushed By:	wiz
Date:		Sat May 7 14:04:31 2016 +0200
Changeset:	e9883e8c20c2a48c8f637edcffe797ebe22ebb25

Modified Files:
	Makefile
Added Files:
	paxtest/DESCR
	paxtest/Makefile
	paxtest/PLIST
	paxtest/distinfo
	paxtest/patches/patch-Makefile.OpenBSD

Log Message:
paxtest: add tool for testing pax functionality

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=e9883e8c20c2a48c8f637edcffe797ebe22ebb25

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                               |  1 +
 paxtest/DESCR                          | 19 +++++++++++++++++++
 paxtest/Makefile                       | 29 +++++++++++++++++++++++++++++
 paxtest/PLIST                          | 29 +++++++++++++++++++++++++++++
 paxtest/distinfo                       |  7 +++++++
 paxtest/patches/patch-Makefile.OpenBSD | 15 +++++++++++++++
 6 files changed, 100 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 039232a..18c6eeb 100644
--- a/Makefile
+++ b/Makefile
@@ -2434,6 +2434,7 @@ SUBDIR+=	partonevolution
 SUBDIR+=	pasmo
 SUBDIR+=	passepartout
 SUBDIR+=	paxmirabilis
+SUBDIR+=	paxtest
 SUBDIR+=	pbbuttonsd
 SUBDIR+=	pcmanfm
 SUBDIR+=	pcmanfm-qt
diff --git a/paxtest/DESCR b/paxtest/DESCR
new file mode 100644
index 0000000..ec75c0b
--- /dev/null
+++ b/paxtest/DESCR
@@ -0,0 +1,19 @@
+When I started the Adamantix project, one of the first things I did
+was to add PaX functionality to the kernel. PaX is a process memory
+protection patch.  Anything that happens outside the kernel on a
+UNIX system happens inside a process. There are many attacks on the
+Internet that try to corrupt the process memory, in order to make
+it do something for which it was not intended. One example of such
+an attack is the so called buffer overflow attack. This kind of
+attack is one of the most popular at this moment.
+
+PaX protects against such attacks. Or so the author claims. When I
+started to add PaX to Adamantix, almost nothing happened. A few
+libraries broke, but that was easy to fix, and that was it. I
+expected many programs to break. So I started to wonder: ``Does
+this patch really do anything?'' Instead of speculating, I decided
+to write a test suite. After some time, the first version of paxtest
+was ready. More functionality was added. With the addition of every
+test, it proved that PaX was working just fine. I decided to publish
+paxtest, because it can be useful for other people to test the
+functionality of the memory protection of their system(s).
diff --git a/paxtest/Makefile b/paxtest/Makefile
new file mode 100644
index 0000000..8e5f093
--- /dev/null
+++ b/paxtest/Makefile
@@ -0,0 +1,29 @@
+# $NetBSD$
+
+DISTNAME=	paxtest-0.9.14
+CATEGORIES=	security
+MASTER_SITES=	https://www.grsecurity.net/~spender/
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	http://pax.grsecurity.net/
+COMMENT=	Test program for PaX functionality
+LICENSE=	gnu-gpl-v2
+
+USE_TOOLS+=	gmake
+
+MAKE_FILE=	Makefile.OpenBSD
+# These override the Makefile default settings, so compare when updating
+MAKE_FLAGS+=	CFLAGS="-Wl,-R${PREFIX}/lib -fno-stack-protector -DRUNDIR=\\\"${PREFIX}/libexec/paxtest\\\""
+MAKE_FLAGS+=	LDFLAGS="-R${PREFIX}/lib -lpthread"
+MAKE_FLAGS+=	RUNDIR=${PREFIX}/libexec/paxtest
+
+INSTALLATION_DIRS+=	bin lib libexec/paxtest
+
+do-install:
+	${INSTALL_SCRIPT} ${WRKSRC}/paxtest ${DESTDIR}${PREFIX}/bin
+	${INSTALL_LIB} ${WRKSRC}/shlibtest*.so ${DESTDIR}${PREFIX}/lib
+	for i in anonmap execbss execdata execheap execstack mprotanon mprotbss mprotdata mprotheap mprotshbss mprotshdata mprotstack randamap randheap1 randmain1 randshlib randstack1 randstack2 rettofunc1 rettofunc1x rettofunc2 rettofunc2x shlibbss shlibdata writetext; do \
+		${INSTALL_PROGRAM} ${WRKSRC}/$$i ${DESTDIR}${PREFIX}/libexec/paxtest; \
+	done
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/paxtest/PLIST b/paxtest/PLIST
new file mode 100644
index 0000000..8546111
--- /dev/null
+++ b/paxtest/PLIST
@@ -0,0 +1,29 @@
+@comment $NetBSD$
+bin/paxtest
+lib/shlibtest.so
+lib/shlibtest2.so
+libexec/paxtest/anonmap
+libexec/paxtest/execbss
+libexec/paxtest/execdata
+libexec/paxtest/execheap
+libexec/paxtest/execstack
+libexec/paxtest/mprotanon
+libexec/paxtest/mprotbss
+libexec/paxtest/mprotdata
+libexec/paxtest/mprotheap
+libexec/paxtest/mprotshbss
+libexec/paxtest/mprotshdata
+libexec/paxtest/mprotstack
+libexec/paxtest/randamap
+libexec/paxtest/randheap1
+libexec/paxtest/randmain1
+libexec/paxtest/randshlib
+libexec/paxtest/randstack1
+libexec/paxtest/randstack2
+libexec/paxtest/rettofunc1
+libexec/paxtest/rettofunc1x
+libexec/paxtest/rettofunc2
+libexec/paxtest/rettofunc2x
+libexec/paxtest/shlibbss
+libexec/paxtest/shlibdata
+libexec/paxtest/writetext
diff --git a/paxtest/distinfo b/paxtest/distinfo
new file mode 100644
index 0000000..3c4c044
--- /dev/null
+++ b/paxtest/distinfo
@@ -0,0 +1,7 @@
+$NetBSD$
+
+SHA1 (paxtest-0.9.14.tar.gz) = 867873f49e3d2cbb1b8221195876230506a47d73
+RMD160 (paxtest-0.9.14.tar.gz) = 7f7c95f8f8e5c1d408439cb8876bb52a0e778cd7
+SHA512 (paxtest-0.9.14.tar.gz) = 6e2d642e1dfe7e3381ed520956d2f5b19ad8c8e569c4ddcf43a2772a76ed67701bb18fe55d7fe2b82ff50644f92470622243ac974083d87448f560f6d48d8727
+Size (paxtest-0.9.14.tar.gz) = 34286 bytes
+SHA1 (patch-Makefile.OpenBSD) = fc9de99aa12618537bb260c23ecc87c2db89489d
diff --git a/paxtest/patches/patch-Makefile.OpenBSD b/paxtest/patches/patch-Makefile.OpenBSD
new file mode 100644
index 0000000..ca9f1cb
--- /dev/null
+++ b/paxtest/patches/patch-Makefile.OpenBSD
@@ -0,0 +1,15 @@
+$NetBSD$
+
+These two tests don't have a main() function.
+
+--- Makefile.OpenBSD.orig	2015-09-29 12:15:56.000000000 +0000
++++ Makefile.OpenBSD
+@@ -29,8 +29,6 @@ TESTS=	anonmap \
+ 	randshlib \
+ 	randstack1 \
+ 	randstack2 \
+-	randarg1 \
+-	randarg2 \
+ 	rettofunc1 \
+ 	rettofunc1x \
+ 	rettofunc2 \


Home | Main Index | Thread Index | Old Index