[compiler-rt] [compiler-rt][rtsan] ptrace interception on Linux. (PR #123941)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 05:28:38 PST 2025


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 c6c647588f911770170d2f7975b325f3d70cf89b 878e3f5f6b8f01ba10b070fae3093da8cb426002 --extensions cpp -- compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
index dd707b581f..e44413c188 100644
--- a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
@@ -1173,15 +1173,16 @@ INTERCEPTOR(long, ptrace, enum __ptrace_request request, ...) {
 #endif
   va_list args;
 
-  // A handful of ptrace requests need an additional argument on Linux/sparc (e.g. PTRACE_READDATA)
-  // but we only intercept the standard calls at the moment.
-  // We might to rework all if rtsan is supported on BSD, interfaces differ vastly, data is read in word size
-  // on Linux vs large chunks on freebsd and so on ...
+  // A handful of ptrace requests need an additional argument on Linux/sparc
+  // (e.g. PTRACE_READDATA) but we only intercept the standard calls at the
+  // moment. We might to rework all if rtsan is supported on BSD, interfaces
+  // differ vastly, data is read in word size on Linux vs large chunks on
+  // freebsd and so on ...
   va_start(args, request);
   pid_t pid = va_arg(args, pid_t);
 
-  // addr and data types depend on the request, either of these are ignored in some cases too.
-  // using intptr_t to be able to hold accepted ptrace types.
+  // addr and data types depend on the request, either of these are ignored in
+  // some cases too. using intptr_t to be able to hold accepted ptrace types.
   using arg_type = intptr_t;
   static_assert(sizeof(arg_type) >= sizeof(struct ptrace_seekinfo_args *));
   static_assert(sizeof(arg_type) >= sizeof(int));

``````````

</details>


https://github.com/llvm/llvm-project/pull/123941


More information about the llvm-commits mailing list