From: Tamir Duberstein <tamird@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>,
syzbot <syzbot+092bbab7da235a02a03a@syzkaller.appspotmail.com>,
asml.silence@gmail.com, io-uring@vger.kernel.org,
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [syzbot] [io-uring?] KASAN: null-ptr-deref Write in sys_io_uring_register
Date: Wed, 4 Dec 2024 11:30:25 -0500 [thread overview]
Message-ID: <CAJ-ks9k5BZ1eSezMZX2oRT8JbNDra1-PoFa+dWnboW_kT4d11A@mail.gmail.com> (raw)
In-Reply-To: <Z1CCbyZVOXQRDz_2@casper.infradead.org>
On Wed, Dec 4, 2024 at 11:25 AM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Wed, Dec 04, 2024 at 09:17:27AM -0700, Jens Axboe wrote:
> > > XA_STATE(xas, xa, index);
> > > - return xas_result(&xas, xas_store(&xas, NULL));
> > > + return xas_result(&xas, xa_zero_to_null(xas_store(&xas, NULL)));
> > > }
> > > EXPORT_SYMBOL(__xa_erase);
> > >
> > > This would explain deletion of a reserved entry returning
> > > `XA_ZERO_ENTRY` rather than `NULL`.
> >
> > Yep this works.
> >
> > > My apologies for this breakage. Should I send a new version? A new
> > > "fixes" patch?
> >
> > Since it seems quite drastically broken, and since it looks like Andrew
> > is holding it, seems like the best course of action would be to have it
> > folded with the existing patch.
>
> ... and please include an addition to the test-suite that would catch
> this bug.
>
> Wait, why doesn't this one catch it? You did run the test-suite, right?
>
> /* xa_insert treats it as busy */
> XA_BUG_ON(xa, xa_reserve(xa, 12345678, GFP_KERNEL) != 0);
> XA_BUG_ON(xa, xa_insert(xa, 12345678, xa_mk_value(12345678), 0) !=
> -EBUSY);
> XA_BUG_ON(xa, xa_empty(xa));
> XA_BUG_ON(xa, xa_erase(xa, 12345678) != NULL);
> XA_BUG_ON(xa, !xa_empty(xa));
I thought I did, but when I ran it again just now, this test did catch
it. So there is coverage.
next prev parent reply other threads:[~2024-12-04 16:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 13:56 [syzbot] [io-uring?] KASAN: null-ptr-deref Write in sys_io_uring_register syzbot
2024-12-04 15:01 ` Jens Axboe
2024-12-04 15:10 ` Jens Axboe
2024-12-04 15:21 ` Tamir Duberstein
2024-12-04 16:17 ` Jens Axboe
2024-12-04 16:25 ` Matthew Wilcox
2024-12-04 16:30 ` Tamir Duberstein [this message]
2024-12-04 18:39 ` Tamir Duberstein
2024-12-04 18:43 ` Jens Axboe
2024-12-04 18:51 ` Matthew Wilcox
2024-12-04 18:55 ` Tamir Duberstein
2024-12-04 16:30 ` Jens Axboe
2024-12-04 20:18 ` [syzbot] [mm] " syzbot
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=CAJ-ks9k5BZ1eSezMZX2oRT8JbNDra1-PoFa+dWnboW_kT4d11A@mail.gmail.com \
--to=tamird@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+092bbab7da235a02a03a@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=willy@infradead.org \
/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