<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/kernel/trace, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>Merge tag 'bpf-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf</title>
<updated>2026-11-21T01:41:06+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-11-21T01:41:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=84afebd853437e44cb71f718be11d90e4c1a59dd'/>
<id>84afebd853437e44cb71f718be11d90e4c1a59dd</id>
<content type='text'>
Pull bpf fixes from Alexei Starovoitov:
 "Mostly sockmap fixes as promised, plus uprobe ctx rewrite via bpf and
  cgroup-bpf fixes.

   - Reject writable map iterators on read-only maps (Adethya
     Srinivasan)

   - Various sockmap fixes (Alexei Starovoitov):
       - Clear the redirect target before the sk_msg prog runs
       - Check that the redirected message is the cork
       - Leave sk_stream_wait_memory() once the socket is dead
       - Keep the rest of the cork after a redirect
       - Don't let an SK_PASS verdict cover the next message
       - Subtract all dropped bytes from the return value of sendmsg()
       - Clear the end mark of elements added by bpf_msg_push_data() and
         bpf_msg_pop_data()

   - Fix ring capacity invariant break in bpf_msg_push_data() (Bo Cao)

   - Report RCU-tasks quiescent states in do_check() to fix rcu_tasks
     stalls during a long verification (Breno Leitao)

   - Various sockmap fixes (Chris Mason):
       - Give no progs to a TCP listener
       - Check the target of an egress redirect before each send
       - Check the TCP state in recvmsg()
       - Reset the copy position when corking
       - Don't copy 0 bytes into a full cork

   - Use a dedicated workqueue for freeing BPF programs to fix a
     deadlock between pack_mutex waiters and the vmalloc purge work
     (Emil Tsalapatis)

   - Fix verifier model mismatch on a narrow read of
     __sk_buff.remote_port (Henry Martin)

   - Fix bpf-gcc CO-RE relocation in verifier_sockmap_mutate selftest
     (Jiayuan Chen)

   - Restrict uprobe ctx writes to the registers that ptrace can set
     (Jiri Olsa)

   - Various sockmap fixes (Josef Bacik):
       - Write sg.start when recvmsg() faults
       - Don't let an SK_DROP verdict stick
       - Clear the resume state of a stopped psock

   - Various fixes (Michal Luczaj):
       - Fix "unresolved symbol tcp_request_sock" build error with
         CONFIG_INET=n
       - Restrict iter-context sockmap updates to iter/sockmap
       - Restrict bpf_sock_destroy() to iter/{tcp,udp}
       - Mark bpf_iter__sockmap::sk as PTR_TRUSTED

   - Mark backing_file_alloc/free LSM hooks as untrusted (Sergei
     Nizovtsev)

   - Various cgroup-bpf fixes (Shakeel Butt):
       - Don't read freed effective arrays in BPF_PROG_QUERY
       - Don't attach to a removed cgroup
       - Protect cgroup_bpf state with its own mutex, so that queries
         and the release work don't wait for cgroup_mutex
       - Don't lose errors in effective BPF_LSM_CGROUP queries

   - Check variable-offset accesses against special fields (Shihuang
     Liu)"

* tag 'bpf-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: (38 commits)
  selftests/bpf: Test which ctx registers a uprobe prog can write
  bpf: Restrict uprobe ctx writes to the registers ptrace can set
  selftests/bpf: Fix bpf-gcc CO-RE relocation in verifier_sockmap_mutate
  bpf, cgroup: Don't lose errors in effective BPF_LSM_CGROUP queries
  bpf, cgroup: Protect cgroup_bpf state with its own mutex
  bpf, cgroup: Don't attach to a removed cgroup
  bpf, cgroup: Don't read freed effective arrays in BPF_PROG_QUERY
  bpf: Fix verifier model mismatch on __sk_buff.remote_port narrow read
  bpf: Fix "unresolved symbol tcp_request_sock" build error
  selftests/bpf: Add iter/sockmap bpf_sock_destroy() negative test
  bpf: Mark bpf_iter__sockmap::sk as PTR_TRUSTED
  bpf: Restrict bpf_sock_destroy() to iter/{tcp,udp}
  bpf, docs: Document BPF_ITER_NOSLEEP
  selftests/bpf: Add negative test for sockmap update from non-sockmap iter
  bpf, sockmap: Restrict iter-context sockmap updates to iter/sockmap
  selftests/bpf: Remove sockmap update from bpf_iter_unix
  bpf, lsm: Mark backing_file_alloc/free LSM hooks as untrusted
  bpf: Report RCU-tasks quiescent states in do_check()
  bpf: Check variable-offset accesses against special fields
  bpf: Use dedicated workqueue for freeing BPF programs
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull bpf fixes from Alexei Starovoitov:
 "Mostly sockmap fixes as promised, plus uprobe ctx rewrite via bpf and
  cgroup-bpf fixes.

   - Reject writable map iterators on read-only maps (Adethya
     Srinivasan)

   - Various sockmap fixes (Alexei Starovoitov):
       - Clear the redirect target before the sk_msg prog runs
       - Check that the redirected message is the cork
       - Leave sk_stream_wait_memory() once the socket is dead
       - Keep the rest of the cork after a redirect
       - Don't let an SK_PASS verdict cover the next message
       - Subtract all dropped bytes from the return value of sendmsg()
       - Clear the end mark of elements added by bpf_msg_push_data() and
         bpf_msg_pop_data()

   - Fix ring capacity invariant break in bpf_msg_push_data() (Bo Cao)

   - Report RCU-tasks quiescent states in do_check() to fix rcu_tasks
     stalls during a long verification (Breno Leitao)

   - Various sockmap fixes (Chris Mason):
       - Give no progs to a TCP listener
       - Check the target of an egress redirect before each send
       - Check the TCP state in recvmsg()
       - Reset the copy position when corking
       - Don't copy 0 bytes into a full cork

   - Use a dedicated workqueue for freeing BPF programs to fix a
     deadlock between pack_mutex waiters and the vmalloc purge work
     (Emil Tsalapatis)

   - Fix verifier model mismatch on a narrow read of
     __sk_buff.remote_port (Henry Martin)

   - Fix bpf-gcc CO-RE relocation in verifier_sockmap_mutate selftest
     (Jiayuan Chen)

   - Restrict uprobe ctx writes to the registers that ptrace can set
     (Jiri Olsa)

   - Various sockmap fixes (Josef Bacik):
       - Write sg.start when recvmsg() faults
       - Don't let an SK_DROP verdict stick
       - Clear the resume state of a stopped psock

   - Various fixes (Michal Luczaj):
       - Fix "unresolved symbol tcp_request_sock" build error with
         CONFIG_INET=n
       - Restrict iter-context sockmap updates to iter/sockmap
       - Restrict bpf_sock_destroy() to iter/{tcp,udp}
       - Mark bpf_iter__sockmap::sk as PTR_TRUSTED

   - Mark backing_file_alloc/free LSM hooks as untrusted (Sergei
     Nizovtsev)

   - Various cgroup-bpf fixes (Shakeel Butt):
       - Don't read freed effective arrays in BPF_PROG_QUERY
       - Don't attach to a removed cgroup
       - Protect cgroup_bpf state with its own mutex, so that queries
         and the release work don't wait for cgroup_mutex
       - Don't lose errors in effective BPF_LSM_CGROUP queries

   - Check variable-offset accesses against special fields (Shihuang
     Liu)"

* tag 'bpf-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: (38 commits)
  selftests/bpf: Test which ctx registers a uprobe prog can write
  bpf: Restrict uprobe ctx writes to the registers ptrace can set
  selftests/bpf: Fix bpf-gcc CO-RE relocation in verifier_sockmap_mutate
  bpf, cgroup: Don't lose errors in effective BPF_LSM_CGROUP queries
  bpf, cgroup: Protect cgroup_bpf state with its own mutex
  bpf, cgroup: Don't attach to a removed cgroup
  bpf, cgroup: Don't read freed effective arrays in BPF_PROG_QUERY
  bpf: Fix verifier model mismatch on __sk_buff.remote_port narrow read
  bpf: Fix "unresolved symbol tcp_request_sock" build error
  selftests/bpf: Add iter/sockmap bpf_sock_destroy() negative test
  bpf: Mark bpf_iter__sockmap::sk as PTR_TRUSTED
  bpf: Restrict bpf_sock_destroy() to iter/{tcp,udp}
  bpf, docs: Document BPF_ITER_NOSLEEP
  selftests/bpf: Add negative test for sockmap update from non-sockmap iter
  bpf, sockmap: Restrict iter-context sockmap updates to iter/sockmap
  selftests/bpf: Remove sockmap update from bpf_iter_unix
  bpf, lsm: Mark backing_file_alloc/free LSM hooks as untrusted
  bpf: Report RCU-tasks quiescent states in do_check()
  bpf: Check variable-offset accesses against special fields
  bpf: Use dedicated workqueue for freeing BPF programs
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>bpf: Restrict uprobe ctx writes to the registers ptrace can set</title>
<updated>2026-11-20T02:30:59+00:00</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@kernel.org</email>
</author>
<published>2026-11-18T08:44:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ca44731a7009da1dbcdf1979438d1985d93331d1'/>
<id>ca44731a7009da1dbcdf1979438d1985d93331d1</id>
<content type='text'>
Since commit 7384893d970e ("bpf: Allow uprobe program to change context
registers") a uprobe program can write any field of struct pt_regs.
Some of those fields are not plain user registers. The exit to user
space loads them into the CPU:

  arch    field   exit path                        ptrace
  ------  ------  -------------------------------  ------------------
  riscv   status  csrw CSR_STATUS, a0              not in the regset
  arm64   pstate  msr spsr_el1, x22                valid_user_regs()
  x86-64  cs, ss  (cs &amp; 3) == 0: iretq to ring 0   set_segment_reg()
  x86-64  flags   iretq loads IF and IOPL          set_flags()

On riscv a program that sets sstatus.SPP in pt_regs.status makes
ret_from_exception return to user code in supervisor mode. On x86-64 a
program that writes a kernel selector to cs makes iretq return to
ring 0.
ptrace guards these fields, but the bpf verifier does not.

Add arch_uprobe_regs_writable(). Each arch lists the registers that
ptrace can set to any value, and kprobe_prog_is_valid_access() rejects
writes to any other offset when the program is loaded:

  arm64:   x0 to x30, sp, pc
  riscv:   epc, ra to t6
  x86-64:  r15 to di, ip, sp

The default is no writes, so arches without a list (and 32-bit x86)
lose ctx writes for uprobe programs. Reads are not affected.

flags on x86-64 and pstate on arm64 become read-only, including the
condition bits that ptrace would let a debugger change. orig_ax is
read-only too.

Kprobe programs that write ctx were already rejected when they were
attached. Those that write one of these fields now fail to load.

Fixes: 7384893d970e ("bpf: Allow uprobe program to change context registers")
Reported-by: rtm@csail.mit.edu
Suggested-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261118084451.12590-2-jolsa@kernel.org
Closes: https://lore.kernel.org/bpf/30318.1794850523@30-11-166.wireless.csail.mit.edu/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since commit 7384893d970e ("bpf: Allow uprobe program to change context
registers") a uprobe program can write any field of struct pt_regs.
Some of those fields are not plain user registers. The exit to user
space loads them into the CPU:

  arch    field   exit path                        ptrace
  ------  ------  -------------------------------  ------------------
  riscv   status  csrw CSR_STATUS, a0              not in the regset
  arm64   pstate  msr spsr_el1, x22                valid_user_regs()
  x86-64  cs, ss  (cs &amp; 3) == 0: iretq to ring 0   set_segment_reg()
  x86-64  flags   iretq loads IF and IOPL          set_flags()

On riscv a program that sets sstatus.SPP in pt_regs.status makes
ret_from_exception return to user code in supervisor mode. On x86-64 a
program that writes a kernel selector to cs makes iretq return to
ring 0.
ptrace guards these fields, but the bpf verifier does not.

Add arch_uprobe_regs_writable(). Each arch lists the registers that
ptrace can set to any value, and kprobe_prog_is_valid_access() rejects
writes to any other offset when the program is loaded:

  arm64:   x0 to x30, sp, pc
  riscv:   epc, ra to t6
  x86-64:  r15 to di, ip, sp

The default is no writes, so arches without a list (and 32-bit x86)
lose ctx writes for uprobe programs. Reads are not affected.

flags on x86-64 and pstate on arm64 become read-only, including the
condition bits that ptrace would let a debugger change. orig_ax is
read-only too.

Kprobe programs that write ctx were already rejected when they were
attached. Those that write one of these fields now fail to load.

Fixes: 7384893d970e ("bpf: Allow uprobe program to change context registers")
Reported-by: rtm@csail.mit.edu
Suggested-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261118084451.12590-2-jolsa@kernel.org
Closes: https://lore.kernel.org/bpf/30318.1794850523@30-11-166.wireless.csail.mit.edu/
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'perf-urgent-2026-11-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2026-11-15T17:01:48+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-11-15T17:01:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ca6709295ae5420d1a391f32e6a7f23b7fda14b3'/>
<id>ca6709295ae5420d1a391f32e6a7f23b7fda14b3</id>
<content type='text'>
Pull perf events fixes from Ingo Molnar:

 - Avoid AMD uncore context migration from non-owners (Sandipan Das)

 - Clear stop state in perf_trace_add(), to fix self-profilers such as
   async-profiler. Also fix a similar bug in hw_breakpoint_add() (Paolo
   Bertinetti)

 - Fix racy update of cpc-&gt;hrtimer_interval (Benjamin Segall)

 - Do not resurrect cpuctx-&gt;cgrp after last cgroup event exit, to fix
   UAF bug (Phat Dinh)

* tag 'perf-urgent-2026-11-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf/core: Do not resurrect cpuctx-&gt;cgrp after last cgroup event exit
  perf: Fix racy update of cpc-&gt;hrtimer_interval
  perf/hw_breakpoint: Clear stop state in hw_breakpoint_add()
  tracing/perf: Clear stop state in perf_trace_add()
  perf/x86/amd/uncore: Avoid context migration from non-owners
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull perf events fixes from Ingo Molnar:

 - Avoid AMD uncore context migration from non-owners (Sandipan Das)

 - Clear stop state in perf_trace_add(), to fix self-profilers such as
   async-profiler. Also fix a similar bug in hw_breakpoint_add() (Paolo
   Bertinetti)

 - Fix racy update of cpc-&gt;hrtimer_interval (Benjamin Segall)

 - Do not resurrect cpuctx-&gt;cgrp after last cgroup event exit, to fix
   UAF bug (Phat Dinh)

* tag 'perf-urgent-2026-11-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf/core: Do not resurrect cpuctx-&gt;cgrp after last cgroup event exit
  perf: Fix racy update of cpc-&gt;hrtimer_interval
  perf/hw_breakpoint: Clear stop state in hw_breakpoint_add()
  tracing/perf: Clear stop state in perf_trace_add()
  perf/x86/amd/uncore: Avoid context migration from non-owners
</pre>
</div>
</content>
</entry>
<entry>
<title>tracing/uprobes: Fix memory leak of tail in __trace_uprobe_create()</title>
<updated>2026-11-13T14:06:31+00:00</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-11-13T08:29:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c15120853eebbda98f3fe1f1e59370439c6c4447'/>
<id>c15120853eebbda98f3fe1f1e59370439c6c4447</id>
<content type='text'>
When generating a default event name in __trace_uprobe_create(), tail is
allocated with kstrdup() without __free(kfree). If the subsequent
kmalloc() for buf fails, the function returns -ENOMEM immediately and
leaks tail.

Declare tail with __free(kfree) so it is automatically freed on all
exit paths.

Link: https://lore.kernel.org/all/179455856197.403392.16569431894958507645.stgit@devnote2/

Reported-by: Sashiko &lt;sashiko-bot@kernel.org&gt;
Closes: https://lore.kernel.org/all/sashiko-outbox-204240@kernel.org/
Fixes: 97e8230f89a3 ("tracing: uprobe-event: Allocate string buffers from heap")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When generating a default event name in __trace_uprobe_create(), tail is
allocated with kstrdup() without __free(kfree). If the subsequent
kmalloc() for buf fails, the function returns -ENOMEM immediately and
leaks tail.

Declare tail with __free(kfree) so it is automatically freed on all
exit paths.

Link: https://lore.kernel.org/all/179455856197.403392.16569431894958507645.stgit@devnote2/

Reported-by: Sashiko &lt;sashiko-bot@kernel.org&gt;
Closes: https://lore.kernel.org/all/sashiko-outbox-204240@kernel.org/
Fixes: 97e8230f89a3 ("tracing: uprobe-event: Allocate string buffers from heap")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>tracing/probes: Reject array count on non-dereference string sources</title>
<updated>2026-11-13T14:06:23+00:00</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-11-13T08:29:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0941144ebeaf3ce46c80711f00e935921eb28b21'/>
<id>0941144ebeaf3ce46c80711f00e935921eb28b21</id>
<content type='text'>
The runtime array loop (FETCH_OP_LP_ARRAY) for string types requires a
preceding memory dereference instruction so it can advance the pointer
address on each iteration. Non-dereference string sources such as $comm,
immediate strings, and eprobe event fields cannot be indexed as pointer
arrays, but finalize_fetch_insn() still accepts an array count on them
and emits an invalid FETCH_OP_LP_ARRAY sequence.

Reject string array counts when the preceding operation is not a memory
dereference.

Link: https://lore.kernel.org/all/179455855309.403392.4197028577158545202.stgit@devnote2/

Fixes: 40b53b771806 ("tracing: probeevent: Add array type support")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The runtime array loop (FETCH_OP_LP_ARRAY) for string types requires a
preceding memory dereference instruction so it can advance the pointer
address on each iteration. Non-dereference string sources such as $comm,
immediate strings, and eprobe event fields cannot be indexed as pointer
arrays, but finalize_fetch_insn() still accepts an array count on them
and emits an invalid FETCH_OP_LP_ARRAY sequence.

Reject string array counts when the preceding operation is not a memory
dereference.

Link: https://lore.kernel.org/all/179455855309.403392.4197028577158545202.stgit@devnote2/

Fixes: 40b53b771806 ("tracing: probeevent: Add array type support")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>tracing/probes: Fix user-space dereference string array store type</title>
<updated>2026-11-13T14:05:56+00:00</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-11-13T08:29:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2721573e6c6faaba2e31f352f2c02ec5f3ecf5e9'/>
<id>2721573e6c6faaba2e31f352f2c02ec5f3ecf5e9</id>
<content type='text'>
When finalizing a string array argument (e.g. +0u(%reg):string[N]),
finalize_fetch_insn() advances the instruction pointer to a new slot
for the store operation before checking whether the preceding operation
was FETCH_OP_UDEREF. As a result, user-space dereference string arrays
with type "string" emit FETCH_OP_ST_STRING (kernel memory read) instead
of FETCH_OP_ST_USTRING.

Check for FETCH_OP_UDEREF before advancing the instruction pointer.

Link: https://lore.kernel.org/all/179455854396.403392.18073771811100192405.stgit@devnote2/

Fixes: e65f7ae7f4da ("tracing/probe: Support user-space dereference")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When finalizing a string array argument (e.g. +0u(%reg):string[N]),
finalize_fetch_insn() advances the instruction pointer to a new slot
for the store operation before checking whether the preceding operation
was FETCH_OP_UDEREF. As a result, user-space dereference string arrays
with type "string" emit FETCH_OP_ST_STRING (kernel memory read) instead
of FETCH_OP_ST_USTRING.

Check for FETCH_OP_UDEREF before advancing the instruction pointer.

Link: https://lore.kernel.org/all/179455854396.403392.18073771811100192405.stgit@devnote2/

Fixes: e65f7ae7f4da ("tracing/probe: Support user-space dereference")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>tracing/eprobe: Disallow attaching eprobes to fprobe events</title>
<updated>2026-11-13T14:05:46+00:00</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-11-13T08:28:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=92d9fa0ed69e1f724feed908bd0a462a42df4b88'/>
<id>92d9fa0ed69e1f724feed908bd0a462a42df4b88</id>
<content type='text'>
Event probes (eprobes) are not allowed to attach to other dynamic probe
events (kprobes, uprobes, and eprobes) to avoid recursive probe chains
and lifecycle dependencies. However, when fprobe events were introduced,
TRACE_EVENT_FL_FPROBE was omitted from the exclusion mask in
find_and_get_event(), allowing eprobes to attach to fprobe and tprobe
events.

Exclude TRACE_EVENT_FL_FPROBE events in find_and_get_event().

Link: https://lore.kernel.org/all/179455853457.403392.14549390017750529531.stgit@devnote2/

Fixes: 334e5519c375 ("tracing/probes: Add fprobe events for tracing function entry and exit.")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Event probes (eprobes) are not allowed to attach to other dynamic probe
events (kprobes, uprobes, and eprobes) to avoid recursive probe chains
and lifecycle dependencies. However, when fprobe events were introduced,
TRACE_EVENT_FL_FPROBE was omitted from the exclusion mask in
find_and_get_event(), allowing eprobes to attach to fprobe and tprobe
events.

Exclude TRACE_EVENT_FL_FPROBE events in find_and_get_event().

Link: https://lore.kernel.org/all/179455853457.403392.14549390017750529531.stgit@devnote2/

Fixes: 334e5519c375 ("tracing/probes: Add fprobe events for tracing function entry and exit.")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>tracing/eprobe: Fix 1-byte signed field fetch in get_event_field()</title>
<updated>2026-11-13T14:05:30+00:00</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-11-13T08:28:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a0f836eea463d4c468edb58eedb03911c9c0791d'/>
<id>a0f836eea463d4c468edb58eedb03911c9c0791d</id>
<content type='text'>
Because the kernel is built with -funsigned-char, plain 'char' is
unsigned on all architectures. Reading 1-byte signed trace event fields
via *(char *)addr in get_event_field() therefore zero-extends instead of
sign-extending negative s8 values.

Use explicit fixed-width integer types (s8/u8, s16/u16, s32/u32) when
reading event fields.

Link: https://lore.kernel.org/all/179455852542.403392.15666310371702309464.stgit@devnote2/

Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Because the kernel is built with -funsigned-char, plain 'char' is
unsigned on all architectures. Reading 1-byte signed trace event fields
via *(char *)addr in get_event_field() therefore zero-extends instead of
sign-extending negative s8 values.

Use explicit fixed-width integer types (s8/u8, s16/u16, s32/u32) when
reading event fields.

Link: https://lore.kernel.org/all/179455852542.403392.15666310371702309464.stgit@devnote2/

Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>tracing/probes: Fix missing BTF kind checks in char pointer/array helpers</title>
<updated>2026-11-13T14:04:56+00:00</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-11-13T08:28:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c1e2c63e65421068566db3dde44dfd4fe7adb46d'/>
<id>c1e2c63e65421068566db3dde44dfd4fe7adb46d</id>
<content type='text'>
In struct btf_type, the type ID and byte size share a union, and only
BTF_KIND_INT types are followed by a 32-bit integer encoding word.
Because btf_type_is_char_ptr() and btf_type_is_char_array() do not
verify that the outer type is BTF_KIND_PTR or that the resolved element
type is a non-NULL BTF_KIND_INT before inspecting it, non-pointer BTF
types can have their byte size misinterpreted as a BTF type ID, and
arrays of non-integer types read out-of-bounds or misinterpret trailing
BTF metadata as BTF_INT_* encoding bits.

Validate the BTF type kinds and NULL pointers before reading inner type
metadata in both helpers.

Link: https://lore.kernel.org/all/179455851632.403392.258264246782960594.stgit@devnote2/

Fixes: 27973e5c64b9 ("tracing/probes: Add string type check with BTF")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In struct btf_type, the type ID and byte size share a union, and only
BTF_KIND_INT types are followed by a 32-bit integer encoding word.
Because btf_type_is_char_ptr() and btf_type_is_char_array() do not
verify that the outer type is BTF_KIND_PTR or that the resolved element
type is a non-NULL BTF_KIND_INT before inspecting it, non-pointer BTF
types can have their byte size misinterpreted as a BTF type ID, and
arrays of non-integer types read out-of-bounds or misinterpret trailing
BTF metadata as BTF_INT_* encoding bits.

Validate the BTF type kinds and NULL pointers before reading inner type
metadata in both helpers.

Link: https://lore.kernel.org/all/179455851632.403392.258264246782960594.stgit@devnote2/

Fixes: 27973e5c64b9 ("tracing/probes: Add string type check with BTF")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write</title>
<updated>2026-11-13T14:04:48+00:00</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-11-13T08:28:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9b6e9d6a11090ac34516c45f48663b37ac94a9b1'/>
<id>9b6e9d6a11090ac34516c45f48663b37ac94a9b1</id>
<content type='text'>
BTF bitfield parsing in trace_probe.c assumes a 64-bit (8-byte) container
when computing FETCH_OP_MOD_BF shift amounts and basesize, whereas the
preceding store instruction only allocates and writes the field's fetch
type size (which may be 1, 2, or 4 bytes when kflag=1). At runtime,
fetch_apply_bitfield() performs an 8-byte read-modify-write on the
smaller ring buffer slot, corrupting adjacent ring buffer data or writing
past the end of the event record.

In addition, signed bitfields with bit widths other than 8/16/32/64 fail
to resolve a fetch type, bitfields whose width is a multiple of 8 inside
a larger integer or spanning a byte boundary fail to emit FETCH_OP_MOD_BF
or select a container wide enough for bitoffs + bitsize, kflag=0 bitfield
offsets &gt;= 8 bits are not folded into the byte offset, and big-endian
architectures use the little-endian left-shift formula in
parse_btf_bitfield().

Compute the bitfield byte and bit offsets consistently during field
lookup, select the smallest unsigned fetch type that covers the bit
offset and bit width, and calculate the FETCH_OP_MOD_BF parameters from
the selected fetch type size for both big- and little-endian bitfields.

Link: https://lore.kernel.org/all/179455850711.403392.10512730891220678403.stgit@devnote2/

Fixes: c440adfbe302 ("tracing/probes: Support BTF based data structure field access")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
BTF bitfield parsing in trace_probe.c assumes a 64-bit (8-byte) container
when computing FETCH_OP_MOD_BF shift amounts and basesize, whereas the
preceding store instruction only allocates and writes the field's fetch
type size (which may be 1, 2, or 4 bytes when kflag=1). At runtime,
fetch_apply_bitfield() performs an 8-byte read-modify-write on the
smaller ring buffer slot, corrupting adjacent ring buffer data or writing
past the end of the event record.

In addition, signed bitfields with bit widths other than 8/16/32/64 fail
to resolve a fetch type, bitfields whose width is a multiple of 8 inside
a larger integer or spanning a byte boundary fail to emit FETCH_OP_MOD_BF
or select a container wide enough for bitoffs + bitsize, kflag=0 bitfield
offsets &gt;= 8 bits are not folded into the byte offset, and big-endian
architectures use the little-endian left-shift formula in
parse_btf_bitfield().

Compute the bitfield byte and bit offsets consistently during field
lookup, select the smallest unsigned fetch type that covers the bit
offset and bit width, and calculate the FETCH_OP_MOD_BF parameters from
the selected fetch type size for both big- and little-endian bitfields.

Link: https://lore.kernel.org/all/179455850711.403392.10512730891220678403.stgit@devnote2/

Fixes: c440adfbe302 ("tracing/probes: Support BTF based data structure field access")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</pre>
</div>
</content>
</entry>
</feed>
