lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20260112073125.4115607-1-xiangw985@gmail.com>
Date: Mon, 12 Jan 2026 15:31:25 +0800
From: Wang Xiang <xiangw985@...il.com>
To: acme@...nel.org,
	namhyung@...nel.org
Cc: peterz@...radead.org,
	mingo@...hat.com,
	mark.rutland@....com,
	alexander.shishkin@...ux.intel.com,
	jolsa@...nel.org,
	irogers@...gle.com,
	adrian.hunter@...el.com,
	james.clark@...aro.org,
	yangsonghua@...iang.com,
	wangxiang3@...iang.com,
	linux-perf-users@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] tools headers: Sync UAPI linux/openat2.h with the kernel sources

From: Wang Xiang <wangxiang3@...iang.com>

Since commit 3d6cfbaf279d ("perf beauty: Introduce scrape script for
various fs syscalls 'flags' arguments"), the file
tools/perf/trace/beauty/include/uapi/linux/fcntl.h includes
<linux/openat2.h>, but openat2.h was never synced to the
tools/perf/trace/beauty/include/uapi/linux/ directory, even though it
was added to the BEAUTY_FILES check list in tools/perf/check-headers.sh.

This causes a compilation failure:
  $ aarch64-linux-gnu-gcc -E
  tools/perf/trace/beauty/include/uapi/linux/fcntl.h \
  -I./tools/perf/trace/beauty/include/uapi

  tools/perf/trace/beauty/include/uapi/linux/fcntl.h:6:10: fatal error:
  linux/openat2.h: No such file or directory 6 | #include
  <linux/openat2.h>

So, now we need sync openat2.h from include/uapi/linux/openat2.h to fix this
dependency.

Signed-off-by: Wang Xiang <wangxiang3@...iang.com>
---
 tools/perf/check-headers.sh                   |  1 +
 .../trace/beauty/include/uapi/linux/openat2.h | 43 +++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 tools/perf/trace/beauty/include/uapi/linux/openat2.h

diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh
index e0537f275da2..411a45d8f9f6 100755
--- a/tools/perf/check-headers.sh
+++ b/tools/perf/check-headers.sh
@@ -95,6 +95,7 @@ declare -a BEAUTY_FILES=(
   "include/uapi/linux/fcntl.h"
   "include/uapi/linux/fs.h"
   "include/uapi/linux/mount.h"
+  "include/uapi/linux/openat2.h"
   "include/uapi/linux/prctl.h"
   "include/uapi/linux/sched.h"
   "include/uapi/linux/stat.h"
diff --git a/tools/perf/trace/beauty/include/uapi/linux/openat2.h b/tools/perf/trace/beauty/include/uapi/linux/openat2.h
new file mode 100644
index 000000000000..a5feb7604948
--- /dev/null
+++ b/tools/perf/trace/beauty/include/uapi/linux/openat2.h
@@ -0,0 +1,43 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+#ifndef _UAPI_LINUX_OPENAT2_H
+#define _UAPI_LINUX_OPENAT2_H
+
+#include <linux/types.h>
+
+/*
+ * Arguments for how openat2(2) should open the target path. If only @flags and
+ * @mode are non-zero, then openat2(2) operates very similarly to openat(2).
+ *
+ * However, unlike openat(2), unknown or invalid bits in @flags result in
+ * -EINVAL rather than being silently ignored. @mode must be zero unless one of
+ * {O_CREAT, O_TMPFILE} are set.
+ *
+ * @flags: O_* flags.
+ * @mode: O_CREAT/O_TMPFILE file mode.
+ * @resolve: RESOLVE_* flags.
+ */
+struct open_how {
+	__u64 flags;
+	__u64 mode;
+	__u64 resolve;
+};
+
+/* how->resolve flags for openat2(2). */
+#define RESOLVE_NO_XDEV		0x01 /* Block mount-point crossings
+					(includes bind-mounts). */
+#define RESOLVE_NO_MAGICLINKS	0x02 /* Block traversal through procfs-style
+					"magic-links". */
+#define RESOLVE_NO_SYMLINKS	0x04 /* Block traversal through all symlinks
+					(implies OEXT_NO_MAGICLINKS) */
+#define RESOLVE_BENEATH		0x08 /* Block "lexical" trickery like
+					"..", symlinks, and absolute
+					paths which escape the dirfd. */
+#define RESOLVE_IN_ROOT		0x10 /* Make all jumps to "/" and ".."
+					be scoped inside the dirfd
+					(similar to chroot(2)). */
+#define RESOLVE_CACHED		0x20 /* Only complete if resolution can be
+					completed through cached lookup. May
+					return -EAGAIN if that's not
+					possible. */
+
+#endif /* _UAPI_LINUX_OPENAT2_H */
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ