From: Roberto Sassu <roberto.sassu@huaweicloud.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: syzbot <syzbot+3f0b3970f154dfc95e6e@syzkaller.appspotmail.com>,
dmitry.kasatkin@gmail.com, eric.snowberg@oracle.com,
jmorris@namei.org, linux-integrity@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org, paul@paul-moore.com,
roberto.sassu@huawei.com, serge@hallyn.com,
syzkaller-bugs@googlegroups.com, zohar@linux.ibm.com,
linux-bcachefs@vger.kernel.org
Subject: Re: [syzbot] [lsm?] [integrity?] KMSAN: uninit-value in ima_add_template_entry (3)
Date: Thu, 15 May 2025 18:39:48 +0200 [thread overview]
Message-ID: <2993afd1b2b1553a75d1016ec2d06b6fb8e78e57.camel@huaweicloud.com> (raw)
In-Reply-To: <l7xs6ea7takb5yvyvobxoce3mudbgen5d7s47onksm4ujpdkib@tvstwbdpvm4o>
On Thu, 2025-05-15 at 12:37 -0400, Kent Overstreet wrote:
> On Thu, May 15, 2025 at 04:30:09PM +0200, Roberto Sassu wrote:
> > On Thu, 2025-05-15 at 10:18 -0400, Kent Overstreet wrote:
> > > On Thu, May 15, 2025 at 04:06:02PM +0200, Roberto Sassu wrote:
> > > > On Wed, 2025-05-14 at 07:54 -0700, syzbot wrote:
> > > > > Hello,
> > > >
> > > > + Kent, bcachefs mailing list
> > > >
> > > > I have the feeling that this was recently fixed in one of the latest
> > > > pull requests in bcachefs. I don't see it occurring anymore, and there
> > > > are more commits after the one reported by syzbot.
> > >
> > > I have no idea how any of the ima stuff works or even what it does, I'm
> > > not even sure where I'd start...
> >
> > Basically, I got a clue that bcachefs would be the cause from the
> > bottom of the report:
> >
> > page_cache_sync_ra+0x108a/0x13e0 mm/readahead.c:621
> > filemap_get_pages+0xfb3/0x3a70 mm/filemap.c:2591
> > filemap_read+0x5c6/0x2190 mm/filemap.c:2702
> > bch2_read_iter+0x559/0x21c0 fs/bcachefs/fs-io-direct.c:221
> > __kernel_read+0x750/0xda0 fs/read_write.c:528
> > integrity_kernel_read+0x77/0x90 security/integrity/iint.c:28
> >
> > This means that IMA is reading a file and calculating a digest over it:
> >
> > ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:498 [inline]
> > ima_calc_file_shash security/integrity/ima/ima_crypto.c:511 [inline]
> > ima_calc_file_hash+0x240a/0x3fd0 security/integrity/ima/ima_crypto.c:568
> > ima_collect_measurement+0x45d/0xe60 security/integrity/ima/ima_api.c:293
> > process_measurement+0x2d1a/0x40e0 security/integrity/ima/ima_main.c:385
> > ima_file_check+0x8e/0xd0 security/integrity/ima/ima_main.c:613
> >
> > syzbot is complaining that the data the digest was calculated from was
> > not initialized (e.g. zeroed).
> >
> > There is a reproducer, we would be probably able to do a bisection and
> > find the commit that caused it (and maybe the one that fixed it).
>
> Ok, that would be fixed by the - multiple - KMSAN fixes, most of those
> were spurious but code was lacking annotations. Probably this one:
>
> 9c3a2c9b471a bcachefs: Disable asm memcpys when kmsan enabled
Perfect, thanks a lot!
Will check it and mark this report as fixed.
Roberto
next prev parent reply other threads:[~2025-05-15 16:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 14:54 [syzbot] [lsm?] [integrity?] KMSAN: uninit-value in ima_add_template_entry (3) syzbot
2025-05-15 14:06 ` Roberto Sassu
2025-05-15 14:18 ` Kent Overstreet
2025-05-15 14:30 ` Roberto Sassu
2025-05-15 16:37 ` Kent Overstreet
2025-05-15 16:39 ` Roberto Sassu [this message]
2025-05-15 16:48 ` Kent Overstreet
2025-05-15 16:52 ` Roberto Sassu
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=2993afd1b2b1553a75d1016ec2d06b6fb8e78e57.camel@huaweicloud.com \
--to=roberto.sassu@huaweicloud.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=eric.snowberg@oracle.com \
--cc=jmorris@namei.org \
--cc=kent.overstreet@linux.dev \
--cc=linux-bcachefs@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=roberto.sassu@huawei.com \
--cc=serge@hallyn.com \
--cc=syzbot+3f0b3970f154dfc95e6e@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=zohar@linux.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).