]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
bpf attr->raw_tracepoint.name may be NULL for BPF_RAW_TRACEPOINT_OPEN.
authorMark Wielaard <mark@klomp.org>
Sat, 19 Mar 2022 00:06:40 +0000 (01:06 +0100)
committerMark Wielaard <mark@klomp.org>
Sat, 19 Mar 2022 00:06:40 +0000 (01:06 +0100)
For BPF_RAW_TRACEPOINT_OPEN attr->raw_tracepoint.name may be NULL.
Otherwise it should point to a valid (max 128 char) string. Only
raw_tracepoint.prog_fd needs to be set.

https://bugs.kde.org/show_bug.cgi?id=451626

NEWS
coregrind/m_syswrap/syswrap-linux.c

diff --git a/NEWS b/NEWS
index 8ed4898aab7b195049cc4c0b298e760a27a0775a..404467180ed7cd7ee4e94d1fcc125b1cdaf42e3f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -71,6 +71,7 @@ are not entered into bugzilla tend to get forgotten about or ignored.
 450025  Powerc: ACC file not implemented as a logical overlay of the VSR
         registers.
 450536  Powerpc: valgrind throws 'facility scv unavailable exception'
+451626  Syscall param bpf(attr->raw_tracepoint.name) points to unaddressable byte(s)
 
 To see details of a given bug, visit
   https://bugs.kde.org/show_bug.cgi?id=XXXXXX
index b9d531de38bcbeb50f6a127c36f9c89772648e53..38edccc9833a2c994d805d2556f87132d4181b36 100644 (file)
@@ -12920,8 +12920,9 @@ PRE(sys_bpf)
                break;
             }
             /* Name is limited to 128 characters in kernel/bpf/syscall.c. */
-            pre_asciiz_str(tid, attr->raw_tracepoint.name, 128,
-                           "bpf(attr->raw_tracepoint.name)");
+            if (attr->raw_tracepoint.name != NULL)
+               pre_asciiz_str(tid, attr->raw_tracepoint.name, 128,
+                              "bpf(attr->raw_tracepoint.name)");
          }
          break;
       case VKI_BPF_BTF_LOAD: