[compiler-rt] [compiler-rt] adding fchmodat2 syscall introduced in Linux 6.6. (PR #82275)

David CARLIER via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 11:52:16 PST 2024


https://github.com/devnexen created https://github.com/llvm/llvm-project/pull/82275

None

>From 82f9b900e61f58fb6a9858ab51d81e0cf7d1d0bd Mon Sep 17 00:00:00 2001
From: David Carlier <devnexen at gmail.com>
Date: Mon, 19 Feb 2024 19:50:54 +0000
Subject: [PATCH] [compiler-rt] adding fchmodat2 syscall introduced in Linux
 6.6.

---
 .../lib/sanitizer_common/sanitizer_common_syscalls.inc   | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc
index c10943b3e48793..fb3cef1a56e7a6 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc
@@ -2808,6 +2808,15 @@ PRE_SYSCALL(fchownat)
 POST_SYSCALL(fchownat)
 (long res, long dfd, const void *filename, long user, long group, long flag) {}
 
+PRE_SYSCALL(fchmodat2)(long dfd, const void *filename, long mode, long flag) {
+  if (filename)
+    PRE_READ(filename,
+             __sanitizer::internal_strlen((const char *)filename) + 1);
+}
+
+POST_SYSCALL(fchmodat2)(long res, long dfd, const void *filename, long mode, long flag) {}
+
+
 PRE_SYSCALL(openat)(long dfd, const void *filename, long flags, long mode) {
   if (filename)
     PRE_READ(filename,



More information about the llvm-commits mailing list