From: Dave Chinner <david@fromorbit.com>
To: Marius Fleischer <fleischermarius@gmail.com>
Cc: Leah Rumancik <leah.rumancik@gmail.com>,
"Darrick J. Wong" <djwong@kernel.org>,
linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
harrisonmichaelgreen@gmail.com, syzkaller@googlegroups.com
Subject: Re: KASAN: null-ptr-deref Write in xlog_cil_commit
Date: Fri, 19 Apr 2024 08:02:20 +1000 [thread overview]
Message-ID: <ZiGYbJezGZg6tGgq@dread.disaster.area> (raw)
In-Reply-To: <CAJg=8jz0X=CKR1POvF41oEumrq1z=MVWPdF2ECbzV6-rhht8-g@mail.gmail.com>
On Thu, Apr 18, 2024 at 11:03:30AM -0700, Marius Fleischer wrote:
> Hi,
>
>
> We would like to report the following bug which has been found by our
> modified version of syzkaller.
>
> ======================================================
>
> description: KASAN: null-ptr-deref Write in xlog_cil_commit
>
> affected file: fs/xfs/xfs_log_cil.c
>
> kernel version: 5.15.156
Really old kernel.
> We took a very brief look at the code. Is it possible that there is a check
> missing for the return value of kvmalloc at fs/xfs/xfs_log_cil.c:224?
>
> lv = kvmalloc(buf_size, GFP_KERNEL);
> memset(lv, 0, xlog_cil_iovec_space(niovecs));
I've never seen that memory allocation fail there, and that code has
been using an unchecked, open coded kvmalloc() for well over a
decade. We replaced it with a direct call to kvmalloc() in 5.15,
but the failure semantics here never changed.
But I guess it could fail if error injection is enabled,
and because we used to call __vmalloc() directly it may never have
had errors injected?
But, regardless, that's completely irrelevant.
We replaced the kvmalloc() call there with a guaranteed "no fail"
open coded loop in 5.17 for performance reasons, so this open coded
kvmalloc() call only existed in 5.15 and 5.16. See commit
8dc9384b7d75 ("xfs: reduce kvmalloc overhead for CIL shadow
buffers").
-Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2024-04-18 22:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-18 18:03 KASAN: null-ptr-deref Write in xlog_cil_commit Marius Fleischer
2024-04-18 22:02 ` Dave Chinner [this message]
[not found] ` <CAJg=8jycPX=fQskUb=48g=AS7-uUNAVKZyZ+tyAC5uGYwfpabg@mail.gmail.com>
2024-04-21 23:48 ` Dave Chinner
2024-04-23 15:05 ` Marius Fleischer
2024-04-24 3:42 ` Darrick J. Wong
2024-04-25 20:31 ` Leah Rumancik
2024-04-25 20:33 ` Marius Fleischer
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=ZiGYbJezGZg6tGgq@dread.disaster.area \
--to=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=fleischermarius@gmail.com \
--cc=harrisonmichaelgreen@gmail.com \
--cc=leah.rumancik@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=syzkaller@googlegroups.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