From d2e7768725266cd5471a802eb50ca1716071e28b Mon Sep 17 00:00:00 2001 From: Rmys Date: Thu, 15 Jun 2023 10:58:33 +0300 Subject: [PATCH] audit ver. bump --- system/base/audit/actions.py | 1 + .../audit-3.0.8-linux-headers-5.17.patch | 41 +++++++++++++++++++ .../gentoo/audit-3.0.8-musl-malloc.patch | 28 +++++++++++++ system/base/audit/pspec.xml | 12 +++++- 4 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 system/base/audit/files/gentoo/audit-3.0.8-linux-headers-5.17.patch create mode 100644 system/base/audit/files/gentoo/audit-3.0.8-musl-malloc.patch diff --git a/system/base/audit/actions.py b/system/base/audit/actions.py index 2b830dbe..1454114b 100644 --- a/system/base/audit/actions.py +++ b/system/base/audit/actions.py @@ -10,6 +10,7 @@ from pisi.actionsapi import shelltools from pisi.actionsapi import get def setup(): + shelltools.export("PYTHON", "/usr/bin/python3") autotools.autoreconf("-vif") autotools.configure("--with-libcap-ng=yes \ --enable-gssapi-krb5=no \ diff --git a/system/base/audit/files/gentoo/audit-3.0.8-linux-headers-5.17.patch b/system/base/audit/files/gentoo/audit-3.0.8-linux-headers-5.17.patch new file mode 100644 index 00000000..8d41d836 --- /dev/null +++ b/system/base/audit/files/gentoo/audit-3.0.8-linux-headers-5.17.patch @@ -0,0 +1,41 @@ +Upstream rejected a workaround/fix at https://github.com/linux-audit/audit-userspace/pull/253 +/ https://github.com/linux-audit/audit-userspace/issues/252#issuecomment-1078595249. + +Instead, in Fedora (same maintainer as upstream), they're patching the headers then unpatching before install. + +Apparently the swig bindings are on their way out but I'm not convinced that's going to be a quick migration given the API will.. surely change? + +It's not ideal but let's take the patch slyfox ended up using in nixpkgs anyway. + +https://bugs.gentoo.org/836702 + +From beed138222421a2eb4212d83cb889404bd7efc49 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Wed, 23 Mar 2022 07:27:05 +0000 +Subject: [PATCH] auditswig.i: avoid setter generation for audit_rule_data::buf + +As it's a flexible array generated code was never safe to use. +With kernel's https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ed98ea2128b6fd83bce13716edf8f5fe6c47f574 +change it's a build failure now: + + audit> audit_wrap.c:5010:15: error: invalid use of flexible array member + audit> 5010 | arg1->buf = (char [])(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size)); + audit> | ^ + +Let's avoid setter generation entirely. + +Closes: https://github.com/linux-audit/audit-userspace/issues/252 +--- a/bindings/swig/src/auditswig.i ++++ b/bindings/swig/src/auditswig.i +@@ -39,6 +39,10 @@ signed + #define __attribute(X) /*nothing*/ + typedef unsigned __u32; + typedef unsigned uid_t; ++/* Sidestep SWIG's limitation of handling c99 Flexible arrays by not: ++ * generating setters against them: https://github.com/swig/swig/issues/1699 ++ */ ++%ignore audit_rule_data::buf; + %include "/usr/include/linux/audit.h" + #define __extension__ /*nothing*/ + %include + diff --git a/system/base/audit/files/gentoo/audit-3.0.8-musl-malloc.patch b/system/base/audit/files/gentoo/audit-3.0.8-musl-malloc.patch new file mode 100644 index 00000000..17814dbe --- /dev/null +++ b/system/base/audit/files/gentoo/audit-3.0.8-musl-malloc.patch @@ -0,0 +1,28 @@ +https://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-security/audit/audit/0001-Replace-__attribute_malloc__-with-__attribute__-__ma.patch?id=ad978133a1a10d609bb2545882a2f720a2572f3d +https://bugs.gentoo.org/837275 + +From 79c8d6a2755c9dfa00a5e86378e89a94eef0504d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 9 Aug 2022 23:57:03 -0700 +Subject: [PATCH] Replace __attribute_malloc__ with + __attribute__((__malloc__)) + +__attribute_malloc__ is not available on musl + +Fixes +| ../../git/auparse/auparse.h:54:2: error: expected function body after function declarator +| __attribute_malloc__ __attr_dealloc (auparse_destroy, 1); +| ^ + +Signed-off-by: Khem Raj +--- a/auparse/auparse.h ++++ b/auparse/auparse.h +@@ -51,7 +51,7 @@ typedef void (*auparse_callback_ptr)(auparse_state_t *au, + void auparse_destroy(auparse_state_t *au); + void auparse_destroy_ext(auparse_state_t *au, auparse_destroy_what_t what); + auparse_state_t *auparse_init(ausource_t source, const void *b) +- __attribute_malloc__ __attr_dealloc (auparse_destroy, 1); ++ __attribute__((__malloc__)) __attr_dealloc (auparse_destroy, 1); + int auparse_new_buffer(auparse_state_t *au, const char *data, size_t data_len) + __attr_access ((__read_only__, 2, 3)); + int auparse_feed(auparse_state_t *au, const char *data, size_t data_len) diff --git a/system/base/audit/pspec.xml b/system/base/audit/pspec.xml index 764ca613..6a5114e6 100644 --- a/system/base/audit/pspec.xml +++ b/system/base/audit/pspec.xml @@ -14,7 +14,7 @@ service User space tools for kernel auditing audit contains the user space utilities for storing and searching the audit records generated by the audit subsystem in the Linux 2.6 kernel. - http://people.redhat.com/sgrubb/audit/audit-3.0.6.tar.gz + http://people.redhat.com/sgrubb/audit/audit-3.1.1.tar.gz python3-devel kernel-headers @@ -24,7 +24,8 @@ - + gentoo/audit-3.0.8-linux-headers-5.17.patch + gentoo/audit-3.0.8-musl-malloc.patch @@ -78,6 +79,13 @@ + + 2023-06-15 + 3.1.1 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2022-09-25 3.0.6