public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Steve Sakoman <steve@sakoman.com>
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][kirkstone 19/19] util-linux: Define pidfd_* function signatures
Date: Tue, 29 Oct 2024 11:59:52 -0700	[thread overview]
Message-ID: <2c913a7b66ea756ebc65a573e1b5bb5dba6834d2.1730228268.git.steve@sakoman.com> (raw)
In-Reply-To: <cover.1730228268.git.steve@sakoman.com>

From: Khem Raj <raj.khem@gmail.com>

glibc 2.36 has added sys/pidfd.h and APIs for
pidfd_send_signal and pidfd_open, therefore check
for this header and include it if it exists

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/recipes-core/util-linux/util-linux.inc   |  1 +
 .../0001-check-for-sys-pidfd.h.patch          | 50 +++++++++++++++++++
 2 files changed, 51 insertions(+)
 create mode 100644 meta/recipes-core/util-linux/util-linux/0001-check-for-sys-pidfd.h.patch

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
            file://run-ptest \
            file://display_testname_for_subtest.patch \
            file://avoid_parallel_tests.patch \
+           file://0001-check-for-sys-pidfd.h.patch \
            file://CVE-2024-28085-0001.patch \
            file://CVE-2024-28085-0002.patch \
            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 @@
+From a77af2e46ea233d9e5d3b16396d41a252a5a3172 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 7 Aug 2022 14:39:19 -0700
+Subject: [PATCH] check for sys/pidfd.h
+
+This header in newer glibc defines the signatures of functions
+pidfd_send_signal() and pidfd_open() and when these functions are
+defined by libc then we need to include the relevant header to get
+the definitions. Clang 15+ has started to error out when function
+signatures are missing.
+
+Fixes errors like
+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]
+        if (pidfd_send_signal(pfd, ctl->numsig, &info, 0) < 0)
+
+Upstream-Status: Submitted [https://github.com/util-linux/util-linux/pull/1769]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac          | 1 +
+ include/pidfd-utils.h | 4 +++-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index c38d871..72e893f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -339,6 +339,7 @@ AC_CHECK_HEADERS([ \
+ 	sys/mkdev.h \
+ 	sys/mount.h \
+ 	sys/param.h \
++	sys/pidfd.h \
+ 	sys/prctl.h \
+ 	sys/resource.h \
+ 	sys/sendfile.h \
+diff --git a/include/pidfd-utils.h b/include/pidfd-utils.h
+index 4a6c3a6..7c0c061 100644
+--- a/include/pidfd-utils.h
++++ b/include/pidfd-utils.h
+@@ -4,8 +4,10 @@
+ #if defined(__linux__)
+ # include <sys/syscall.h>
+ # if defined(SYS_pidfd_send_signal) && defined(SYS_pidfd_open)
++#  ifdef HAVE_SYS_PIDFD_H
++#   include <sys/pidfd.h>
++#  endif
+ #  include <sys/types.h>
+-
+ #  ifndef HAVE_PIDFD_SEND_SIGNAL
+ static inline int pidfd_send_signal(int pidfd, int sig, siginfo_t *info,
+ 				    unsigned int flags)
-- 
2.34.1



      parent reply	other threads:[~2024-10-29 19:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29 18:59 [OE-core][kirkstone 00/19] Patch review Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 01/19] ghostscript: Backport CVE-2024-29508 Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 02/19] openssl: patch CVE-2024-9143 Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 03/19] qemu: fix CVE-2023-3019 Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 04/19] python3: ignore fixed CVEs Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 05/19] cve-check: add CVSS vector string to CVE database and reports Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 06/19] cve-check: add support for cvss v4.0 Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 07/19] vim: Upgrade 9.1.0682 -> 9.1.0698 Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 08/19] vim: Upgrade 9.1.0698 -> 9.1.0764 Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 09/19] orc: upgrade 0.4.39 -> 0.4.40 Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 10/19] overlayfs-etc: add option to skip creation of mount dirs Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 11/19] bmap-tools: update HOMEPAGE and SRC_URI Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 12/19] nativesdk-intercept: Fix bad intercept chgrp/chown logic Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 13/19] zip: Make configure checks to be more robust Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 14/19] zip: Fix build with gcc-14 Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 15/19] vala: add -Wno-error=incompatible-pointer-types work around Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 16/19] cracklib: Modify patch to compile with GCC 14 Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 17/19] libffi: backport a fix to build libffi-native with gcc-14 Steve Sakoman
2024-10-29 18:59 ` [OE-core][kirkstone 18/19] at-spi2-core: backport a patch to fix build with gcc-14 on host Steve Sakoman
2024-10-29 18:59 ` Steve Sakoman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2c913a7b66ea756ebc65a573e1b5bb5dba6834d2.1730228268.git.steve@sakoman.com \
    --to=steve@sakoman.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox