Skip to contentSkip to conversation

paxtest: new package

PATCH New Matt Weber 2 participants 5 messages Jul 7, 2017 – Jul 23, 2017

lore
Share & tools
lore

Matt Weber

author
#0 lore raw

PATCH v3 1/1 paxtest: new package

PaX regression test suite

---
Changes v2 -> v3
[Arnout V
- Add Config.in comment when glibc toolchain not used
- Removed PAXTEST_SOURCE assignment as it was default
- Updated ARMv# patch to be anything less then v7 instead of a range from 4-7
- Tested that TARGET_CONFIGURE_OPTS could be used and added it in
- Updated LD= to use TARGET_CC and enclosed in quotes

Changes v1 -> v2
[Matt W
- Ran check-package script against all pkg files
- Added new patch to fix alignment build failure on ARM/NIOS2

[Thomas P
- Added DEVELOPERS
- Commented about GLIBC depends and ran test-pkg to verify why.
- Added URL in Config.in
- Updated pkg to 0.9.15 and refactored move log location patch
- Cleaned up MAKE OPTS use and added MAKE ENV

---
 DEVELOPERS                                         |  1 +
 package/Config.in                                  |  1 +
 .../0001-genpaxtest-move-log-location.patch        | 30 +++++++++++++
 ...paxtest-page-alignment-ARM-and-NIOS2-arch.patch | 49 ++++++++++++++++++++++
 package/paxtest/Config.in                          | 11 +++++
 package/paxtest/paxtest.hash                       |  2 +
 package/paxtest/paxtest.mk                         | 25 +++++++++++
 7 files changed, 119 insertions(+)
 create mode 100644 package/paxtest/0001-genpaxtest-move-log-location.patch
 create mode 100644 package/paxtest/0002-paxtest-page-alignment-ARM-and-NIOS2-arch.patch
 create mode 100644 package/paxtest/Config.in
 create mode 100644 package/paxtest/paxtest.hash
 create mode 100644 package/paxtest/paxtest.mk
DEVELOPERS +1 -0
index 4faa1a8..1edeb67 100644
@@ -1143,6 +1143,7 @@ F:	package/libsepol/
 F:	package/libqmi/
 F:	package/nginx-upload/
 F:	package/omniorb/
+F:	package/paxtest/
 F:	package/policycoreutils/
 F:	package/python-ipy/
 F:	package/python-posix-ipc/
package/Config.in +1 -0
index 46c78a0..c97da17 100644
@@ -1788,6 +1788,7 @@ endmenu
 
 menu "Security"
 	source "package/checkpolicy/Config.in"
+	source "package/paxtest/Config.in"
 	source "package/policycoreutils/Config.in"
 	source "package/refpolicy/Config.in"
 	source "package/sepolgen/Config.in"
package/paxtest/0001-genpaxtest-move-log-location.patch new file +30 -0
new file mode 100644
index 0000000..6447d53
@@ -0,0 +1,30 @@
+From 623d99e4f557ef9cd771006e4f916c12d22a07a8 Mon Sep 17 00:00:00 2001
+From: David Graziano <[email protected]>
+Date: Mon, 12 Jun 2017 10:41:45 -0500
+Subject: [PATCH] genpaxtest: move log location
+
+Move log location to /var/log instead of local directory.
+(For read-only filesystems)
+
+Signed-off-by: David Graziano <[email protected]>
+---
+ genpaxtest | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/genpaxtest b/genpaxtest
+index 5a22e15..d62b15e 100644
+--- a/genpaxtest
++++ b/genpaxtest
+@@ -35,7 +35,7 @@
+        exit 1
+ fi
+
+-LOG=\$HOME/paxtest.log
++LOG=/var/log/paxtest.log
+ [ -n "\$1" ] && LOG=\$1
+ touch "\$LOG"
+ if [ ! -e "\$LOG" ]; then
+ 
+-- 
+1.9.1
+
package/paxtest/0002-paxtest-page-alignment-ARM-and-NIOS2-arch.patch new file +49 -0

49 lines not on this page · raw message

package/paxtest/Config.in new file +11 -0
new file mode 100644
index 0000000..1e09820
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_PAXTEST
+	bool "paxtest"
+	# No UCLIBC or MUSL because __NO_A_OUT_SUPPORT
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	help
+	  PaX regression test suite
+
+	  http://pax.grsecurity.net/docs
+
+comment "paxtest needs a glibc toolchain"
+	depends on !BR2_TOOLCHAIN_USES_GLIBC
package/paxtest/paxtest.hash new file +2 -0
new file mode 100644
index 0000000..c10566c
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256	d553848431fd8c2ab6c8361b62e5cedfed1cc1d60088241f4a33d2af15dd667f	paxtest-0.9.15.tar.gz
package/paxtest/paxtest.mk new file +25 -0
new file mode 100644
index 0000000..5eaee86
@@ -0,0 +1,25 @@
+################################################################################
+#
+# paxtest
+#
+################################################################################
+
+PAXTEST_VERSION = 0.9.15
+PAXTEST_SITE = https://www.grsecurity.net/~spender
+PAXTEST_LICENSE = GPL-2.0+
+PAXTEST_LICENSE_FILES = README
+
+define PAXTEST_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
+		CC="$(TARGET_CC)" LD="$(TARGET_CC)" linux
+endef
+
+define PAXTEST_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
+		CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
+		DESTDIR=$(TARGET_DIR) \
+		BINDIR="usr/bin" \
+		RUNDIR="usr/lib" -f Makefile.psm install
+endef
+
+$(eval $(generic-package))
Signature · 1 line
1.9.1
#1 lore raw

PATCH v3 1/1 paxtest: new package

All,

On Jul 7, 2017 6:44 AM, "Matt Weber" <[email protected]> wrote:

PaX regression test suite

---
Changes v2 -> v3
[Arnout V
- Add Config.in comment when glibc toolchain not used
- Removed PAXTEST_SOURCE assignment as it was default
- Updated ARMv# patch to be anything less then v7 instead of a range from 4-7
- Tested that TARGET_CONFIGURE_OPTS could be used and added it in
- Updated LD= to use TARGET_CC and enclosed in quotes

v3 ready for review

Changes v1 -> v2
[Matt W
- Ran check-package script against all pkg files
- Added new patch to fix alignment build failure on ARM/NIOS2

[Thomas P
- Added DEVELOPERS
- Commented about GLIBC depends and ran test-pkg to verify why.
- Added URL in Config.in
- Updated pkg to 0.9.15 and refactored move log location patch
- Cleaned up MAKE OPTS use and added MAKE ENV

---
 DEVELOPERS                                         |  1 +
 package/Config.in                                  |  1 +
 .../0001-genpaxtest-move-log-location.patch        | 30 +++++++++++++
 ...paxtest-page-alignment-ARM-and-NIOS2-arch.patch | 49
++++++++++++++++++++++
 package/paxtest/Config.in                          | 11 +++++
 package/paxtest/paxtest.hash                       |  2 +
 package/paxtest/paxtest.mk                         | 25 +++++++++++
 7 files changed, 119 insertions(+)
 create mode 100644 package/paxtest/0001-genpaxtest-move-log-location.patch
 create mode 100644 package/paxtest/0002-paxtest-
page-alignment-ARM-and-NIOS2-arch.patch
 create mode 100644 package/paxtest/Config.in
 create mode 100644 package/paxtest/paxtest.hash
 create mode 100644 package/paxtest/paxtest.mk
DEVELOPERS +1 -0
index 4faa1a8..1edeb67 100644
@@ -1143,6 +1143,7 @@ F:        package/libsepol/
 F:     package/libqmi/
 F:     package/nginx-upload/
 F:     package/omniorb/
+F:     package/paxtest/
 F:     package/policycoreutils/
 F:     package/python-ipy/
 F:     package/python-posix-ipc/
package/Config.in +1 -0
index 46c78a0..c97da17 100644
@@ -1788,6 +1788,7 @@ endmenu
 
 menu "Security"
        source "package/checkpolicy/Config.in"
+       source "package/paxtest/Config.in"
        source "package/policycoreutils/Config.in"
        source "package/refpolicy/Config.in"
        source "package/sepolgen/Config.in"
(quoted diff) +0 -0

b/package/paxtest/0001-genpaxtest-move-log-location.patch new file mode 100644
index 0000000..6447d53

package/paxtest/0001-genpaxtest-move-log-location.patch new file +30 -0
@@ -0,0 +1,30 @@
+From 623d99e4f557ef9cd771006e4f916c12d22a07a8 Mon Sep 17 00:00:00 2001
+From: David Graziano <[email protected]>
+Date: Mon, 12 Jun 2017 10:41:45 -0500
+Subject: [PATCH] genpaxtest: move log location
+
+Move log location to /var/log instead of local directory.
+(For read-only filesystems)
+
+Signed-off-by: David Graziano <[email protected]>
+---
+ genpaxtest | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/genpaxtest b/genpaxtest
+index 5a22e15..d62b15e 100644
+--- a/genpaxtest
++++ b/genpaxtest
+@@ -35,7 +35,7 @@
+        exit 1
+ fi
+
+-LOG=\$HOME/paxtest.log
++LOG=/var/log/paxtest.log
+ [ -n "\$1" ] && LOG=\$1
+ touch "\$LOG"
+ if [ ! -e "\$LOG" ]; then
+
+--
+1.9.1
+
(quoted diff) +0 -0

b/package/paxtest/0002-paxtest-page-alignment-ARM-and-NIOS2-arch.patch new file mode 100644
index 0000000..54e5e69

package/paxtest/0002-paxtest-page-alignment-ARM-and-NIOS2-arch.patch new file +49 -0

49 lines not on this page · raw message

package/paxtest/Config.in new file +11 -0
new file mode 100644
index 0000000..1e09820
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_PAXTEST
+       bool "paxtest"
+       # No UCLIBC or MUSL because __NO_A_OUT_SUPPORT
+       depends on BR2_TOOLCHAIN_USES_GLIBC
+       help
+         PaX regression test suite
+
+         http://pax.grsecurity.net/docs
+
+comment "paxtest needs a glibc toolchain"
+       depends on !BR2_TOOLCHAIN_USES_GLIBC
package/paxtest/paxtest.hash new file +2 -0
new file mode 100644
index 0000000..c10566c
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256 d553848431fd8c2ab6c8361b62e5cedfed1cc1d60088241f4a33d2af15dd667f
    paxtest-0.9.15.tar.gz
package/paxtest/paxtest.mk new file +1 -0
new file mode 100644
index 0000000..5eaee86
@@ -0,0 +1,25 @@
+###########################################################

#####################
+#
+# paxtest
+#
+###########################################################
#####################
+
+PAXTEST_VERSION = 0.9.15
+PAXTEST_SITE = https://www.grsecurity.net/~spender
+PAXTEST_LICENSE = GPL-2.0+ +PAXTEST_LICENSE_FILES = README
+
+define PAXTEST_BUILD_CMDS
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
+ CC="$(TARGET_CC)" LD="$(TARGET_CC)" linux
+endef
+
+define PAXTEST_INSTALL_TARGET_CMDS
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \

+               CC="$(TARGET_CC)" LD="$(TARGET_CC)" \
+               DESTDIR=$(TARGET_DIR) \
+               BINDIR="usr/bin" \
+               RUNDIR="usr/lib" -f Makefile.psm install

+endef
+
+$(eval $(generic-package))
--
1.9.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170721/b70f2ad3/attachment.html>

#2 lore raw

PATCH v3 1/1 paxtest: new package

In reply to Matt Weber

Hello,

Quoted 4 lines · Matt Weber

PaX regression test suite

Quoted 9 lines

---
Changes v2 -> v3
[Arnout V
- Add Config.in comment when glibc toolchain not used
- Removed PAXTEST_SOURCE assignment as it was default
- Updated ARMv# patch to be anything less then v7 instead of a range from 4-7
- Tested that TARGET_CONFIGURE_OPTS could be used and added it in
- Updated LD= to use TARGET_CC and enclosed in quotes

Applied to master, thanks. However, I have to say I very much dislike the fact that a bunch of executable programs are installed right into /usr/lib and not /usr/lib/paxtest or something like that. But apparently RUNDIR is used to install both an actual shared library (which must be in /usr/lib) and those executable programs.

Perhaps we could set RUNDIR=/usr/lib/paxtest, and as a post install hook, move the single shared library being installed back into /usr/lib ?

Could you test doing this ?

Since I've applied the patch, it should obviously be done by follow-up patches, based on the latest master.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH v3 1/1 paxtest: new package

Thomas,

Quoted 23 lines · Thomas Petazzoni

Hello,

Quoted 4 lines · Matt Weber

PaX regression test suite

Quoted 9 lines

---
Changes v2 -> v3
[Arnout V
- Add Config.in comment when glibc toolchain not used
- Removed PAXTEST_SOURCE assignment as it was default
- Updated ARMv# patch to be anything less then v7 instead of a range from 4-7
- Tested that TARGET_CONFIGURE_OPTS could be used and added it in
- Updated LD= to use TARGET_CC and enclosed in quotes

Applied to master, thanks. However, I have to say I very much dislike the fact that a bunch of executable programs are installed right into /usr/lib and not /usr/lib/paxtest or something like that. But apparently RUNDIR is used to install both an actual shared library (which must be in /usr/lib) and those executable programs.

Quoted 6 lines

Perhaps we could set RUNDIR=/usr/lib/paxtest, and as a post install hook, move the single shared library being installed back into /usr/lib ?

Could you test doing this ?

Sure, will take a look.
Matt

#4 lore raw

PATCH v3 1/1 paxtest: new package

Thomas,

Quoted 34 lines · Matthew Weber

Thomas,

Quoted 29 lines · Thomas Petazzoni

Hello,

Quoted 4 lines · Matt Weber

PaX regression test suite

Quoted 9 lines

---
Changes v2 -> v3
[Arnout V
- Add Config.in comment when glibc toolchain not used
- Removed PAXTEST_SOURCE assignment as it was default
- Updated ARMv# patch to be anything less then v7 instead of a range from 4-7
- Tested that TARGET_CONFIGURE_OPTS could be used and added it in
- Updated LD= to use TARGET_CC and enclosed in quotes

Applied to master, thanks. However, I have to say I very much dislike the fact that a bunch of executable programs are installed right into /usr/lib and not /usr/lib/paxtest or something like that. But apparently RUNDIR is used to install both an actual shared library (which must be in /usr/lib) and those executable programs.

Perhaps we could set RUNDIR=/usr/lib/paxtest, and as a post install hook, move the single shared library being installed back into /usr/lib ?

Could you test doing this ?

Looks like the /usr/bin/paxtest script (which uses the items installed into RUNDIR) includes handling for LD_LIBRARY_PATH. So we can just update the RUNDIR location and everything falls into place for test apps and shared libs.

https://patchwork.ozlabs.org/patch/792516/

Matt