* [scarthgap][PATCH] fs-util: try AT_EMPTY_PATH for access_fd() first
@ 2026-09-02 10:24 Suresh H A
0 siblings, 0 replies; only message in thread
From: Suresh H A @ 2026-09-02 10:24 UTC (permalink / raw)
To: openembedded-core, suresh.ha; +Cc: Suresh H A
From: Suresh H A <Suresh.HA@bmwtechworks.in>
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 <Suresh.HA@bmwtechworks.in>
---
...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 <me@yhndnzj.com>
+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 <Suresh.HA@bmwtechworks.in>
+---
+ 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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-02 12:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-02 10:24 [scarthgap][PATCH] fs-util: try AT_EMPTY_PATH for access_fd() first Suresh H A
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.