From 8a1e4f1774c57b6e368fdac09df1cca887900fc6 Mon Sep 17 00:00:00 2001 From: dongyuzhen Date: Thu, 23 Mar 2023 11:13:31 +0800 Subject: [PATCH] backport patches from upstream (cherry picked from commit 4ba6275a976f3e9afea1c83ced57a0d35ade14e9) --- audit.spec | 6 +- ...o-interpret-OPENAT2-fields-correctly.patch | 70 +++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 backport-Try-to-interpret-OPENAT2-fields-correctly.patch diff --git a/audit.spec b/audit.spec index 06c1485..23fbaa2 100644 --- a/audit.spec +++ b/audit.spec @@ -2,7 +2,7 @@ Summary: User space tools for kernel auditing Name: audit Epoch: 1 Version: 3.0.1 -Release: 8 +Release: 9 License: GPLv2+ and LGPLv2+ URL: https://people.redhat.com/sgrubb/audit/ Source0: https://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz @@ -42,6 +42,7 @@ Patch30: backport-krb5_cc_store_cred-takes-custody-of-my_creds-so-we-do- Patch31: backport-asprintf-can-return-a-negative-number.patch Patch32: backport-Cleanup-gssapi-code.patch Patch33: backport-Fix-another-krb5-memory-leak.patch +Patch34: backport-Try-to-interpret-OPENAT2-fields-correctly.patch BuildRequires: gcc swig libtool systemd kernel-headers >= 2.6.29 BuildRequires: openldap-devel krb5-devel libcap-ng-devel @@ -377,6 +378,9 @@ fi %attr(644,root,root) %{_mandir}/man8/*.8.gz %changelog +* Thu Mar 23 2023 dongyuzhen - 1:3.0.1-9 +- backport patches from upstream + * Sat Mar 4 2023 zhangguangzhi - 1:3.0.1-8 - del golang_arches for check diff --git a/backport-Try-to-interpret-OPENAT2-fields-correctly.patch b/backport-Try-to-interpret-OPENAT2-fields-correctly.patch new file mode 100644 index 0000000..b52d54f --- /dev/null +++ b/backport-Try-to-interpret-OPENAT2-fields-correctly.patch @@ -0,0 +1,70 @@ +From 83214d7469274dbd60959e32f6c26dda016de048 Mon Sep 17 00:00:00 2001 +From: Steve Grubb +Date: Wed, 8 Feb 2023 13:45:32 -0500 +Subject: [PATCH] Try to interpret OPENAT2 fields correctly + +Conflict: auparse/interpret.c:context adaptation; delete ChangeLog +Reference:https://github.com/linux-audit/audit-userspace/commit/83214d7469274dbd60959e32f6c26dda016de048 +--- + auparse/interpret.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/auparse/interpret.c b/auparse/interpret.c +index ba54948..3e4dc0d 100644 +--- a/auparse/interpret.c ++++ b/auparse/interpret.c +@@ -1390,15 +1390,15 @@ static const char *print_success(const char *val) + return strdup(val); + } + +-static const char *print_open_flags(const char *val) ++static const char *print_open_flags(const char *val, int base) + { + size_t i; +- unsigned int flags; ++ unsigned long flags; + int cnt = 0; + char *out, buf[sizeof(open_flag_strings)+8]; + + errno = 0; +- flags = strtoul(val, NULL, 16); ++ flags = strtoul(val, NULL, base); + if (errno) { + if (asprintf(&out, "conversion error(%s)", val) < 0) + out = NULL; +@@ -2361,10 +2361,10 @@ static const char *print_a1(const char *val, const idata *id) + else if (strcmp(sys, "mknod") == 0) + return print_mode(val, 16); + else if (strcmp(sys, "mq_open") == 0) +- return print_open_flags(val); ++ return print_open_flags(val, 16); + } + else if (strcmp(sys, "open") == 0) +- return print_open_flags(val); ++ return print_open_flags(val, 16); + else if (strcmp(sys, "access") == 0) + return print_access(val); + else if (strcmp(sys, "epoll_ctl") == 0) +@@ -2438,7 +2438,7 @@ static const char *print_a2(const char *val, const idata *id) + goto normal; + } else if (*sys == 'o') { + if (strcmp(sys, "openat") == 0) +- return print_open_flags(val); ++ return print_open_flags(val, 16); + if ((strcmp(sys, "open") == 0) && (id->a1 & O_CREAT)) + return print_mode_short(val, 16); + } else if (*sys == 'f') { +@@ -3077,8 +3077,8 @@ unknown: + case AUPARSE_TYPE_SECCOMP: + out = print_seccomp_code(id->val); + break; +- case AUPARSE_TYPE_OFLAG: +- out = print_open_flags(id->val); ++ case AUPARSE_TYPE_OFLAG: // AUDIT_OPENAT2,MQ_OPEN ++ out = print_open_flags(id->val, 0); + break; + case AUPARSE_TYPE_MMAP: + out = print_mmap(id->val); +-- +2.33.0 + -- Gitee