[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
Thu Mar 7 12:40:54 PST 2024


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

>From 76bf044319c1d36ab04b6656745203e5fa72cfee 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 | 10 ++++++++++
 1 file changed, 10 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..a85fd75a30cf41 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc
@@ -2808,6 +2808,16 @@ 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