lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM9d7cjegWoDE_q3nNydpdyjCvger0_nGWcNCinSWNiXOepe3A@mail.gmail.com>
Date: Tue, 9 Apr 2024 15:29:22 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Ian Rogers <irogers@...gle.com>, Kan Liang <kan.liang@...ux.intel.com>, 
	Jiri Olsa <jolsa@...nel.org>, Adrian Hunter <adrian.hunter@...el.com>, 
	Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...nel.org>, 
	LKML <linux-kernel@...r.kernel.org>, linux-perf-users@...r.kernel.org, 
	Song Liu <song@...nel.org>, bpf@...r.kernel.org
Subject: Re: [PATCH] perf lock contention: Add a missing NULL check

On Tue, Apr 2, 2024 at 2:37 PM Arnaldo Carvalho de Melo <acme@...nel.org> wrote:
>
> On Tue, Apr 02, 2024 at 01:42:05PM -0700, Namhyung Kim wrote:
> > On Tue, Apr 2, 2024 at 12:45 PM Arnaldo Carvalho de Melo <acme@...nel.org> wrote:
> > > Acked-by: Arnaldo Carvalho de Melo <acme@...hat.com>
>
> > > Are you going to have this merged into perf-tools?
>
> > > A Fixes: tag isn't perhaps needed as it worked in the past?
>
> > Fixes: 1811e82767dcc ("perf lock contention: Track and show siglock
> > with address")
>
> > It was introduced in v6.4 and it should be fine to have this
> > even without the error.  I'll queue it to perf-tools.
>
> ok, better, people trying the tool with a recent kernel will experience
> this, so its the right thing to get it thru perf-tools.

Hmm.. it was not sufficient.  I've got another report of failure on loading
the BPF program.  It seems the verifier treated the NULL check and
the later loading separately.

I'll send v2 soon.

Thanks,
Namhyung


; curr = bpf_get_current_task_btf();
264: (85) call bpf_get_current_task_btf#158
   ; frame1: R0_w=trusted_ptr_task_struct(off=0,imm=0)
; if (curr->sighand && &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)
; if (curr->sighand && &curr->sighand->siglock == (void *)lock)
266: (15) if r1 == 0x0 goto pc+5
   ; frame1: R1_w=rcu_ptr_sighand_struct(off=0,imm=0)
267: (b7) r1 = 0                      ; frame1: R1_w=0
; if (curr->sighand && &curr->sighand->siglock == (void *)lock)
268: (79) r2 = *(u64 *)(r0 +2624)
   ; frame1: R0_w=trusted_ptr_task_struct(off=0,imm=0)
      R2_w=rcu_ptr_or_null_sighand_struct(off=0,imm=0)
269: (0f) r2 += r1
R2 pointer arithmetic on rcu_ptr_or_null_ prohibited, null-check it first
processed 166 insns (limit 1000000) max_states_per_insn 0
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ