Merge pull request #1631 from Rmys/master

audit ver. bump
This commit is contained in:
Rmys
2023-06-15 07:59:09 +00:00
committed by GitHub
4 changed files with 80 additions and 2 deletions
+1
View File
@@ -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 \
@@ -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 <slyich@gmail.com>
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 <stdint.i>
@@ -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 <raj.khem@gmail.com>
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 <raj.khem@gmail.com>
--- 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)
+10 -2
View File
@@ -14,7 +14,7 @@
<IsA>service</IsA>
<Summary>User space tools for kernel auditing</Summary>
<Description>audit contains the user space utilities for storing and searching the audit records generated by the audit subsystem in the Linux 2.6 kernel.</Description>
<Archive sha1sum="f35a70557003991585ce850c4bd9d071aa9ac633" type="targz">http://people.redhat.com/sgrubb/audit/audit-3.0.6.tar.gz</Archive>
<Archive sha1sum="6242beaff307d95f2b29f9d758dcf3bceddc0d8a" type="targz">http://people.redhat.com/sgrubb/audit/audit-3.1.1.tar.gz</Archive>
<BuildDependencies>
<Dependency>python3-devel</Dependency>
<Dependency>kernel-headers</Dependency>
@@ -24,7 +24,8 @@
<!-- <Dependency>openldap-client</Dependency> -->
</BuildDependencies>
<Patches>
<!-- <Patch level="1">gcc10.patch</Patch> -->
<Patch level="1">gentoo/audit-3.0.8-linux-headers-5.17.patch</Patch>
<Patch level="1">gentoo/audit-3.0.8-musl-malloc.patch</Patch>
</Patches>
</Source>
@@ -78,6 +79,13 @@
</Package>
<History>
<Update release="10">
<Date>2023-06-15</Date>
<Version>3.1.1</Version>
<Comment>Version bump.</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="9">
<Date>2022-09-25</Date>
<Version>3.0.6</Version>