From: sashiko-bot@kernel.org
Cc: audit@vger.kernel.org
Subject: Re: [PATCH] audit: use rcu_access_pointer() to test inode->i_fsnotify_marks
Date: Wed, 02 Dec 2026 18:16:55 +0000 [thread overview]
Message-ID: <sashiko-outbox-246418@kernel.org> (raw)
In-Reply-To: <20261202181412.4163569-1-zhangjiayi1014@gmail.com>
> handle_one() and handle_path() test inode->i_fsnotify_marks for NULL to
> skip inodes that have no marks before they look up an audit tree chunk. The pointer is an __rcu
> pointer that fsnotify_detach_connector_from_object() clears with
> rcu_assign_pointer() when the last mark of the inode goes away, but the
> tests read it with a plain load. syzbot reports the same race on this
> pointer in fsnotify(), which does the same test:
>
> BUG: KCSAN: data-race in fsnotify / fsnotify_detach_connector_from_object
>
> The race has no functional effect: the tests only compare the pointer
> with NULL, and audit_tree_lookup() then searches the chunk hash under
> RCU and finds no chunk if the mark is gone.
> The plain loads still let the compiler tear or reload them.
>
> Use rcu_access_pointer(), the accessor for testing an __rcu pointer
> without dereferencing it.
>
> Fixes: 08991e83b728 ("fsnotify: Free fsnotify_mark_connector when there is no mark attached")
> Link: https://syzkaller.appspot.com/bug?extid=f968afcac117a84b7f14
> Signed-off-by: Jiayi Zhang <zhangjiayi1014@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261202181412.4163569-1-zhangjiayi1014@gmail.com?part=1
prev parent reply other threads:[~2026-12-02 18:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 18:14 [PATCH] audit: use rcu_access_pointer() to test inode->i_fsnotify_marks Jiayi Zhang
2026-12-02 18:16 ` sashiko-bot [this message]
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=sashiko-outbox-246418@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=audit@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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