From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org
Subject: Re: [PATCH net] ipv6, calipso: fix data-race in calipso_cache_add() bucketsize check
Date: Sun, 15 Nov 2026 14:49:28 +0000 [thread overview]
Message-ID: <sashiko-outbox-215591@kernel.org> (raw)
In-Reply-To: <20261115144508.71543-1-jiayuan.chen@linux.dev>
> Issue found by sashiko when reviewing my data-races patch [1]. This is
> not a plain READ_ONCE() annotation like the rest of that series but a
> real fix, so it is sent separately.
>
> calipso_cache_add() reads calipso_cache_bucketsize twice: the "<= 0"
> guard on entry, then the "size < bucketsize" test after taking the
> bucket lock. A writer can flip it to 0 in between:
>
> CPU0 CPU1
> calipso_cache_add()
> calipso_cache_bucketsize == 10 (> 0)
> proc_dointvec()
> calipso_cache_bucketsize = 0
> spin_lock_bh(&bucket.lock)
> size(0) < calipso_cache_bucketsize(0) -> false
> [ ... ]
>
> [1] https://lore.kernel.org/netdev/179428999963.994134.16904544500890053668@kernel.org/
>
> Fixes: 4fee5242bf41 ("calipso: Add a label cache.")
> Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261115144508.71543-1-jiayuan.chen@linux.dev?part=1
prev parent reply other threads:[~2026-11-15 14:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 14:45 [PATCH net] ipv6, calipso: fix data-race in calipso_cache_add() bucketsize check Jiayuan Chen
2026-11-15 14:49 ` 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-215591@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-security-module@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