diff options
| -rw-r--r-- | meta/recipes-core/util-linux/util-linux.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-core/util-linux/util-linux/0001-check-for-sys-pidfd.h.patch | 50 |
2 files changed, 51 insertions, 0 deletions
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc index f8841e6be0..b9172230e7 100644 --- a/meta/recipes-core/util-linux/util-linux.inc +++ b/meta/recipes-core/util-linux/util-linux.inc | |||
| @@ -35,6 +35,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin | |||
| 35 | file://run-ptest \ | 35 | file://run-ptest \ |
| 36 | file://display_testname_for_subtest.patch \ | 36 | file://display_testname_for_subtest.patch \ |
| 37 | file://avoid_parallel_tests.patch \ | 37 | file://avoid_parallel_tests.patch \ |
| 38 | file://0001-check-for-sys-pidfd.h.patch \ | ||
| 38 | file://CVE-2024-28085-0001.patch \ | 39 | file://CVE-2024-28085-0001.patch \ |
| 39 | file://CVE-2024-28085-0002.patch \ | 40 | file://CVE-2024-28085-0002.patch \ |
| 40 | file://CVE-2024-28085-0003.patch \ | 41 | file://CVE-2024-28085-0003.patch \ |
diff --git a/meta/recipes-core/util-linux/util-linux/0001-check-for-sys-pidfd.h.patch b/meta/recipes-core/util-linux/util-linux/0001-check-for-sys-pidfd.h.patch new file mode 100644 index 0000000000..f2073eba02 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/0001-check-for-sys-pidfd.h.patch | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | From a77af2e46ea233d9e5d3b16396d41a252a5a3172 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sun, 7 Aug 2022 14:39:19 -0700 | ||
| 4 | Subject: [PATCH] check for sys/pidfd.h | ||
| 5 | |||
| 6 | This header in newer glibc defines the signatures of functions | ||
| 7 | pidfd_send_signal() and pidfd_open() and when these functions are | ||
| 8 | defined by libc then we need to include the relevant header to get | ||
| 9 | the definitions. Clang 15+ has started to error out when function | ||
| 10 | signatures are missing. | ||
| 11 | |||
| 12 | Fixes errors like | ||
| 13 | misc-utils/kill.c:402:6: error: call to undeclared function 'pidfd_send_signal'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] | ||
| 14 | if (pidfd_send_signal(pfd, ctl->numsig, &info, 0) < 0) | ||
| 15 | |||
| 16 | Upstream-Status: Submitted [https://github.com/util-linux/util-linux/pull/1769] | ||
| 17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 18 | --- | ||
| 19 | configure.ac | 1 + | ||
| 20 | include/pidfd-utils.h | 4 +++- | ||
| 21 | 2 files changed, 4 insertions(+), 1 deletion(-) | ||
| 22 | |||
| 23 | diff --git a/configure.ac b/configure.ac | ||
| 24 | index c38d871..72e893f 100644 | ||
| 25 | --- a/configure.ac | ||
| 26 | +++ b/configure.ac | ||
| 27 | @@ -339,6 +339,7 @@ AC_CHECK_HEADERS([ \ | ||
| 28 | sys/mkdev.h \ | ||
| 29 | sys/mount.h \ | ||
| 30 | sys/param.h \ | ||
| 31 | + sys/pidfd.h \ | ||
| 32 | sys/prctl.h \ | ||
| 33 | sys/resource.h \ | ||
| 34 | sys/sendfile.h \ | ||
| 35 | diff --git a/include/pidfd-utils.h b/include/pidfd-utils.h | ||
| 36 | index 4a6c3a6..7c0c061 100644 | ||
| 37 | --- a/include/pidfd-utils.h | ||
| 38 | +++ b/include/pidfd-utils.h | ||
| 39 | @@ -4,8 +4,10 @@ | ||
| 40 | #if defined(__linux__) | ||
| 41 | # include <sys/syscall.h> | ||
| 42 | # if defined(SYS_pidfd_send_signal) && defined(SYS_pidfd_open) | ||
| 43 | +# ifdef HAVE_SYS_PIDFD_H | ||
| 44 | +# include <sys/pidfd.h> | ||
| 45 | +# endif | ||
| 46 | # include <sys/types.h> | ||
| 47 | - | ||
| 48 | # ifndef HAVE_PIDFD_SEND_SIGNAL | ||
| 49 | static inline int pidfd_send_signal(int pidfd, int sig, siginfo_t *info, | ||
| 50 | unsigned int flags) | ||
