From: Bart Van Assche <bvanassche@acm.org>
To: Marco Elver <elver@google.com>
Cc: Julia Lawall <Julia.Lawall@inria.fr>,
Nicolas Palix <nicolas.palix@imag.fr>,
linux-kernel@vger.kernel.org, cocci@inria.fr,
kasan-dev@googlegroups.com
Subject: Re: [PATCH v3] coccinelle: locks: Add must_hold.cocci
Date: Mon, 23 Nov 2026 08:25:56 -0800 [thread overview]
Message-ID: <4f7c329e-d722-427e-8279-14c55fce7d71@acm.org> (raw)
In-Reply-To: <20261123104616.226112-1-elver@google.com>
On 11/23/26 2:45 AM, Marco Elver wrote:
> Clang's context analysis treats lockdep_assert_held*() as an assumption
> that the lock is held. A function that asserts instead of being
> annotated with __must_hold() therefore passes the analysis, but its
> callers are never checked.
>
> Add a script that reports functions which assert on all paths that a
> lock is held, where the lock can be named in a function attribute, and
> which are not annotated with __must_hold*(), __releases*(),
> __cond_releases*(), __context_unsafe() or __no_context_analysis. A lock
> can be named if all identifiers in the lock expression are parameters or
> member names, or if it is a global of the form &name or &name.member.
> Functions that mention the lock before asserting it, e.g. to acquire it,
> are skipped.
Bart Van Assche <bvanassche@acm.org>
next prev parent reply other threads:[~2026-11-23 16:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 10:45 Marco Elver
2026-11-23 16:25 ` Bart Van Assche [this message]
2026-11-23 16:27 ` Marco Elver
2026-11-23 17:08 ` Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4f7c329e-d722-427e-8279-14c55fce7d71@acm.org \
--to=bvanassche@acm.org \
--cc=Julia.Lawall@inria.fr \
--cc=cocci@inria.fr \
--cc=elver@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.palix@imag.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®