From: Suresh H A <[email protected]> Backport a fix to try AT_EMPTY_PATH for access_fd() first Fix is already available since systemd v257-rc1.
Signed-off-by: Suresh H A <[email protected]> --- ...ry-AT_EMPTY_PATH-for-access_fd-first.patch | 37 +++++++++++++++++++ meta/recipes-core/systemd/systemd_255.21.bb | 1 + 2 files changed, 38 insertions(+) create mode 100644 meta/recipes-core/systemd/systemd/0023-fs-util-try-AT_EMPTY_PATH-for-access_fd-first.patch diff --git a/meta/recipes-core/systemd/systemd/0023-fs-util-try-AT_EMPTY_PATH-for-access_fd-first.patch b/meta/recipes-core/systemd/systemd/0023-fs-util-try-AT_EMPTY_PATH-for-access_fd-first.patch new file mode 100644 index 0000000000..29dd86c850 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0023-fs-util-try-AT_EMPTY_PATH-for-access_fd-first.patch @@ -0,0 +1,37 @@ +From 55453c9671934fc7ee369788eb0a1a9c8c850e8f Mon Sep 17 00:00:00 2001 +From: Mike Yuan <[email protected]> +Date: Mon, 20 May 2024 19:33:26 +0800 +Subject: [PATCH] fs-util: try AT_EMPTY_PATH for access_fd() first + +Upstream-Status: Backport +[https://github.com/systemd/systemd/pull/32933/commits/c675851d5fd503c1ae5d244f041d43ae9e3ab79b] + +Comment: Patch is refreshed as per codebase of v255 + +Signed-off-by: Suresh H A <[email protected]> +--- + src/basic/fs-util.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c +index ee38e0266a..0f65af1a07 100644 +--- a/src/basic/fs-util.c ++++ b/src/basic/fs-util.c +@@ -664,6 +664,14 @@ int unlink_or_warn(const char *filename) { + int access_fd(int fd, int mode) { + /* Like access() but operates on an already open fd */ + ++ if (faccessat(fd, "", mode, AT_EMPTY_PATH) >= 0) ++ return 0; ++ if (errno != EINVAL) ++ return -errno; ++ ++ /* Support for AT_EMPTY_PATH is added rather late (kernel 5.8), so fall back to going through /proc/ ++ * if unavailable. */ ++ + if (access(FORMAT_PROC_FD_PATH(fd), mode) < 0) { + if (errno != ENOENT) + return -errno; +-- +2.43.0 + diff --git a/meta/recipes-core/systemd/systemd_255.21.bb b/meta/recipes-core/systemd/systemd_255.21.bb index 9c5f8af240..b6e75d42b0 100644 --- a/meta/recipes-core/systemd/systemd_255.21.bb +++ b/meta/recipes-core/systemd/systemd_255.21.bb @@ -33,6 +33,7 @@ SRC_URI += " \ file://CVE-2026-40225-02.patch \ file://CVE-2026-40226-01.patch \ file://CVE-2026-40226-02.patch \ + file://0023-fs-util-try-AT_EMPTY_PATH-for-access_fd-first.patch \ " # patches needed by musl -- 2.43.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#244939): https://lists.openembedded.org/g/openembedded-core/message/244939 Mute This Topic: https://lists.openembedded.org/mt/121049823/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
