summaryrefslogtreecommitdiff
path: root/sys-apps/systemd-utils/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-01-11 11:44:03 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-01-11 11:44:03 +0000
commitdf26c7469c1f2af2e643d43e2e32a6c9142e4885 (patch)
tree1beee9b11d06bfcc69d1d6c8ab00566f8633aec1 /sys-apps/systemd-utils/files
parentad391b961414c99124b93cb86695c04bd8d57937 (diff)
gentoo auto-resync : 11:01:2023 - 11:44:03
Diffstat (limited to 'sys-apps/systemd-utils/files')
-rw-r--r--sys-apps/systemd-utils/files/251-meson-0.64.patch26
-rw-r--r--sys-apps/systemd-utils/files/251-tmpfiles-ub.patch71
2 files changed, 71 insertions, 26 deletions
diff --git a/sys-apps/systemd-utils/files/251-meson-0.64.patch b/sys-apps/systemd-utils/files/251-meson-0.64.patch
deleted file mode 100644
index 6cc200bbd87d..000000000000
--- a/sys-apps/systemd-utils/files/251-meson-0.64.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From cddbc850270415a818aadabd71fe12dc0dddd508 Mon Sep 17 00:00:00 2001
-From: Jan Janssen <medhefgo@web.de>
-Date: Sun, 9 Oct 2022 17:16:12 +0200
-Subject: [PATCH] meson: Fix build with --optimization=plain
-
-Note that -O0 is deliberately filtered out as we have to compile with at
-least -O1 due to #24202.
-
-Fixes: #24323
----
- src/boot/efi/meson.build | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build
-index e0cd4ebad993..395386d3eda7 100644
---- a/src/boot/efi/meson.build
-+++ b/src/boot/efi/meson.build
-@@ -223,7 +223,7 @@ endif
- if get_option('debug') and get_option('mode') == 'developer'
- efi_cflags += ['-ggdb', '-DEFI_DEBUG']
- endif
--if get_option('optimization') != '0'
-+if get_option('optimization') in ['1', '2', '3', 's', 'g']
- efi_cflags += ['-O' + get_option('optimization')]
- endif
- if get_option('b_ndebug') == 'true' or (
diff --git a/sys-apps/systemd-utils/files/251-tmpfiles-ub.patch b/sys-apps/systemd-utils/files/251-tmpfiles-ub.patch
new file mode 100644
index 000000000000..df190d500e34
--- /dev/null
+++ b/sys-apps/systemd-utils/files/251-tmpfiles-ub.patch
@@ -0,0 +1,71 @@
+https://github.com/systemd/systemd/pull/25957
+https://github.com/systemd/systemd/pull/25959
+https://github.com/systemd/systemd/commit/9f804ab04d566ff745849e1c4ced680a0447cf76
+https://github.com/systemd/systemd/commit/34680637e838415204850f77c93ca6ca219abaf1
+
+From 9f804ab04d566ff745849e1c4ced680a0447cf76 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 6 Jan 2023 10:58:32 +0000
+Subject: [PATCH] tmpfiles: avoid null free() for acl attributes
+
+When built with ACL support, we might be processing a tmpfiles
+entry where there's no cause for us to call parse_acls_from_arg,
+then we get to the end of parse_line without having ever populated
+i.{acl_access, acl_default}.
+
+Then we pass a null pointer into acl_free().
+
+From UBSAN w/ GCC 13.0.0_pre20230101:
+```
+$ systemd-tmpfiles --clean
+/var/tmp/portage/sys-apps/acl-2.3.1-r1/work/acl-2.3.1/libacl/acl_free.c:44:14: runtime error: applying non-zero offset 18446744073709551608 to null pointer
+ #0 0x7f65d868b482 in acl_free /var/tmp/portage/sys-apps/acl-2.3.1-r1/work/acl-2.3.1/libacl/acl_free.c:44
+ #1 0x55fe7e592249 in item_free_contents ../systemd-9999/src/tmpfiles/tmpfiles.c:2855
+ #2 0x55fe7e5a347a in parse_line ../systemd-9999/src/tmpfiles/tmpfiles.c:3158
+ #3 0x55fe7e5a347a in read_config_file ../systemd-9999/src/tmpfiles/tmpfiles.c:3897
+ #4 0x55fe7e590c61 in read_config_files ../systemd-9999/src/tmpfiles/tmpfiles.c:3985
+ #5 0x55fe7e590c61 in run ../systemd-9999/src/tmpfiles/tmpfiles.c:4157
+ #6 0x55fe7e590c61 in main ../systemd-9999/src/tmpfiles/tmpfiles.c:4218
+ #7 0x7f65d7ebe289 (/usr/lib64/libc.so.6+0x23289)
+ #8 0x7f65d7ebe344 in __libc_start_main (/usr/lib64/libc.so.6+0x23344)
+ #9 0x55fe7e591900 in _start (/usr/bin/systemd-tmpfiles+0x11900)
+```
+--- a/src/tmpfiles/tmpfiles.c
++++ b/src/tmpfiles/tmpfiles.c
+@@ -2852,8 +2852,11 @@ static void item_free_contents(Item *i) {
+ strv_free(i->xattrs);
+
+ #if HAVE_ACL
+- acl_free(i->acl_access);
+- acl_free(i->acl_default);
++ if (i->acl_access)
++ acl_free(i->acl_access);
++
++ if (i->acl_default)
++ acl_free(i->acl_default);
+ #endif
+ }
+
+
+From 34680637e838415204850f77c93ca6ca219abaf1 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart@poettering.net>
+Date: Fri, 6 Jan 2023 12:30:36 +0100
+Subject: [PATCH] nspawn: guard acl_free() with a NULL check
+
+Inspired by #25957 there's one other place where we don't guard
+acl_free() calls with a NULL check.
+
+Fix that.
+--- a/src/nspawn/nspawn-patch-uid.c
++++ b/src/nspawn/nspawn-patch-uid.c
+@@ -181,7 +181,9 @@ static int patch_acls(int fd, const char *name, const struct stat *st, uid_t shi
+
+ if (S_ISDIR(st->st_mode)) {
+ acl_free(acl);
+- acl_free(shifted);
++
++ if (shifted)
++ acl_free(shifted);
+
+ acl = shifted = NULL;
+