public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5.15,6.1] Fixup preempt imbalance with bpf_trace_printk
@ 2024-02-17 12:13 Thadeu Lima de Souza Cascardo
  2024-02-17 12:13 ` [PATCH 6.1 1/3] bpf: Add struct for bin_args arg in bpf_bprintf_prepare Thadeu Lima de Souza Cascardo
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2024-02-17 12:13 UTC (permalink / raw)
  To: stable; +Cc: cascardo, jolsa, daniel, yhs

When bpf_trace_printk is called without any args in a second depth level,
it will enable preemption without disabling it.

These patch series fix this for 5.15 and 6.1. The fix was introduced in
6.3, so later kernels already have it. And 5.10 and earlier did not have
the code that disabled preemption, so they are fine in that regard.

This was tested by attaching a bpf program doing a non-0 arguments
trace_printk at sys_enter and a 0 arguments snprintf at local_timer_entry.

Dave Marchevsky (1):
  bpf: Merge printk and seq_printf VARARG max macros

Jiri Olsa (3):
  bpf: Add struct for bin_args arg in bpf_bprintf_prepare
  bpf: Do cleanup in bpf_bprintf_cleanup only when needed
  bpf: Remove trace_printk_lock

 include/linux/bpf.h      | 14 ++++++--
 kernel/bpf/helpers.c     | 71 ++++++++++++++++++++++------------------
 kernel/bpf/verifier.c    |  3 +-
 kernel/trace/bpf_trace.c | 39 ++++++++++------------
 4 files changed, 72 insertions(+), 55 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-02-23 15:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-17 12:13 [PATCH 5.15,6.1] Fixup preempt imbalance with bpf_trace_printk Thadeu Lima de Souza Cascardo
2024-02-17 12:13 ` [PATCH 6.1 1/3] bpf: Add struct for bin_args arg in bpf_bprintf_prepare Thadeu Lima de Souza Cascardo
2024-02-17 12:13 ` [PATCH 6.1 2/3] bpf: Do cleanup in bpf_bprintf_cleanup only when needed Thadeu Lima de Souza Cascardo
2024-02-17 12:13 ` [PATCH 6.1 3/3] bpf: Remove trace_printk_lock Thadeu Lima de Souza Cascardo
2024-02-17 12:13 ` [PATCH 5.15 1/4] bpf: Merge printk and seq_printf VARARG max macros Thadeu Lima de Souza Cascardo
2024-02-17 12:13 ` [PATCH 5.15 2/4] bpf: Add struct for bin_args arg in bpf_bprintf_prepare Thadeu Lima de Souza Cascardo
2024-02-17 12:13 ` [PATCH 5.15 3/4] bpf: Do cleanup in bpf_bprintf_cleanup only when needed Thadeu Lima de Souza Cascardo
2024-02-17 12:13 ` [PATCH 5.15 4/4] bpf: Remove trace_printk_lock Thadeu Lima de Souza Cascardo
2024-02-23 15:43 ` [PATCH 5.15,6.1] Fixup preempt imbalance with bpf_trace_printk Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox