[compiler-rt] Reapply [compiler-rt] prctl interception update, SECCOMP_MODE_FILTER … (PR #109834)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 24 10:23:32 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff f4042077e2e3946ee35c1df8cab8237de6086480 c7c84feb5f76f89a633b495d4d42018bd1dbfc3b --extensions inc,h,cpp -- compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h compiler-rt/test/sanitizer_common/TestCases/Linux/prctl.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
index c2b4cc7abf..e3a329712a 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -1291,9 +1291,9 @@ INTERCEPTOR(int, prctl, int option, unsigned long arg2, unsigned long arg3,
static const int PR_GET_PDEATHSIG = 2;
static const int PR_SET_SECCOMP = 22;
-# if !SANITIZER_ANDROID
+# if !SANITIZER_ANDROID
static const int SECCOMP_MODE_FILTER = 2;
-# endif
+# endif
if (option == PR_SET_VMA && arg2 == 0UL) {
char *name = (char *)arg5;
COMMON_INTERCEPTOR_READ_RANGE(ctx, name, internal_strlen(name) + 1);
@@ -1312,11 +1312,11 @@ INTERCEPTOR(int, prctl, int option, unsigned long arg2, unsigned long arg3,
COMMON_INTERCEPTOR_WRITE_RANGE(ctx, (u64 *)(arg5), sizeof(u64));
} else if (res != -1 && option == PR_GET_PDEATHSIG) {
COMMON_INTERCEPTOR_WRITE_RANGE(ctx, (u64 *)(arg2), sizeof(int));
-# if !SANITIZER_ANDROID
+# if !SANITIZER_ANDROID
} else if (res != -1 && option == PR_SET_SECCOMP &&
arg2 == SECCOMP_MODE_FILTER) {
COMMON_INTERCEPTOR_WRITE_RANGE(ctx, (u64 *)(arg3), struct_sock_fprog_sz);
-# endif
+# endif
}
return res;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/109834
More information about the llvm-commits
mailing list