From: Kees Cook <keescook@chromium.org>
To: Jan Kara <jack@suse.cz>
Cc: Theodore Ts'o <tytso@mit.edu>,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
linux-next@vger.kernel.org
Subject: Re: Coverity: jbd_unlock_bh_journal_head(): Memory - corruptions
Date: Tue, 12 Nov 2019 12:58:11 -0800 [thread overview]
Message-ID: <201911121257.3074FDDD@keescook> (raw)
In-Reply-To: <20191112110921.GG1241@quack2.suse.cz>
On Tue, Nov 12, 2019 at 12:09:21PM +0100, Jan Kara wrote:
> Hello,
>
> On Mon 11-11-19 17:35:18, coverity-bot wrote:
> > This is an experimental automated report about issues detected by Coverity
> > from a scan of next-20191108 as part of the linux-next weekly scan project:
> > https://scan.coverity.com/projects/linux-next-weekly-scan
> >
> > You're getting this email because you were associated with the identified
> > lines of code (noted below) that were touched by recent commits:
> >
> > c290ea01abb7 ("fs: Remove ext3 filesystem driver")
> >
> > Coverity reported the following:
> >
> > *** CID 1487847: Memory - corruptions (ARRAY_VS_SINGLETON)
> > /include/linux/jbd2.h: 351 in jbd_unlock_bh_journal_head()
> > 345 {
> > 346 bit_spin_lock(BH_JournalHead, &bh->b_state);
> > 347 }
> > 348
> > 349 static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh)
> > 350 {
> > vvv CID 1487847: Memory - corruptions (ARRAY_VS_SINGLETON)
> > vvv Passing "&bh->b_state" to function "bit_spin_unlock" which uses it as an array. This might corrupt or misinterpret adjacent memory locations.
> > 351 bit_spin_unlock(BH_JournalHead, &bh->b_state);
> > 352 }
>
> This is obviously false positive. I guess coverity needs to learn about
> bit-spinlocks so that it doesn't generate false positive report about each
> usage?
Yeah, that's a pretty weird glitch on Coverity's part. I've taken a note
on this subset of warnings. Thanks for looking at it!
--
Kees Cook
prev parent reply other threads:[~2019-11-12 20:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-12 1:35 Coverity: jbd_unlock_bh_journal_head(): Memory - corruptions coverity-bot
2019-11-12 11:09 ` Jan Kara
2019-11-12 20:58 ` Kees Cook [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=201911121257.3074FDDD@keescook \
--to=keescook@chromium.org \
--cc=gustavo@embeddedor.com \
--cc=jack@suse.cz \
--cc=linux-next@vger.kernel.org \
--cc=tytso@mit.edu \
/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