Namhyung Kim
c418d7a675
perf lock contention: Add a missing NULL check
...
[ Upstream commit f3408580bac8ce5cd76e7391e529c0a22e7c7eb2 ]
I got a report for a failure in BPF verifier on a recent kernel with
perf lock contention command. It checks task->sighand->siglock without
checking if sighand is NULL or not. Let's add one.
; if (&curr->sighand->siglock == (void *)lock)
265: (79) r1 = *(u64 *)(r0 +2624) ; frame1: R0_w=trusted_ptr_task_struct(off=0,imm=0)
; R1_w=rcu_ptr_or_null_sighand_struct(off=0,imm=0)
266: (b7) r2 = 0 ; frame1: R2_w=0
267: (0f) r1 += r2
R1 pointer arithmetic on rcu_ptr_or_null_ prohibited, null-check it first
processed 164 insns (limit 1000000) max_states_per_insn 1 total_states 15 peak_states 15 mark_read 5
-- END PROG LOAD LOG --
libbpf: prog 'contention_end': failed to load: -13
libbpf: failed to load object 'lock_contention_bpf'
libbpf: failed to load BPF skeleton 'lock_contention_bpf': -13
Failed to load lock-contention BPF skeleton
lock contention BPF setup failed
lock contention did not detect any lock contention
Fixes: 1811e82767dcc ("perf lock contention: Track and show siglock with address")
Reviewed-by: Ian Rogers <irogers@google.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Song Liu <song@kernel.org>
Cc: bpf@vger.kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240409225542.1870999-1-namhyung@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-27 17:11:34 +02:00
..
2024-04-10 16:35:47 +02:00
2024-03-26 18:19:27 -04:00
2024-02-05 20:14:31 +00:00
2023-08-08 15:43:03 -06:00
2023-07-24 10:29:52 -04:00
2023-11-20 11:59:18 +01:00
2023-12-03 07:33:02 +01:00
2024-04-13 13:07:38 +02:00
2024-04-03 15:29:03 +02:00
2024-04-13 13:07:36 +02:00
2023-09-05 10:13:45 -07:00
2024-04-10 16:35:41 +02:00
2024-03-26 18:19:35 -04:00
2024-04-27 17:11:34 +02:00
2024-04-13 13:07:31 +02:00
2023-08-03 16:59:40 -03:00
2024-04-27 17:11:32 +02:00
2024-02-23 09:25:15 +01:00
2024-02-23 09:25:14 +01:00
2023-10-16 05:32:23 -04:00
2023-08-07 15:57:25 -10:00