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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMB2axPqr6bw-MgH-QqSRz+1LOuByytOwHj8KWQc-4cG8ykz7g@mail.gmail.com>
Date: Thu, 20 Nov 2025 12:12:12 -0800
From: Amery Hung <ameryhung@...il.com>
To: David Laight <david.laight.linux@...il.com>
Cc: Kumar Kartikeya Dwivedi <memxor@...il.com>, bpf@...r.kernel.org, netdev@...r.kernel.org, 
	alexei.starovoitov@...il.com, andrii@...nel.org, daniel@...earbox.net, 
	kernel-team@...a.com
Subject: Re: [PATCH bpf-next v1 1/1] bpf: Annotate rqspinlock lock acquiring
 functions with __must_check

On Tue, Nov 18, 2025 at 2:42 AM David Laight
<david.laight.linux@...il.com> wrote:
>
> On Tue, 18 Nov 2025 05:16:50 -0500
> Kumar Kartikeya Dwivedi <memxor@...il.com> wrote:
>
> > On Mon, 17 Nov 2025 at 14:15, Amery Hung <ameryhung@...il.com> wrote:
> > >
> > > Locking a resilient queued spinlock can fail when deadlock or timeout
> > > happen. Mark the lock acquring functions with __must_check to make sure
> > > callers always handle the returned error.
> > >
> > > Suggested-by: Andrii Nakryiko <andrii@...nel.org>
> > > Signed-off-by: Amery Hung <ameryhung@...il.com>
> > > ---
> >
> > Looks like it's working :)
> > I would just explicitly ignore with (void) cast the locktorture case.
>
> I'm not sure that works - I usually have to try a lot harder to ignore
> a '__must_check' result.

Thanks for the heads up.

Indeed, gcc still complains about it even casting the return to (void)
while clang does not.

I have to silence the warning by:

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-result"
       raw_res_spin_lock(&rqspinlock);
#pragma GCC diagnostic pop

Thanks!
Amery

>
>         David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ