[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ-ks9mfswrDNPjbakUsEtCTY-GbEoOGkOCrfAymDbDvUFgz5g@mail.gmail.com>
Date: Wed, 4 Dec 2024 13:39:37 -0500
From: Tamir Duberstein <tamird@...il.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: Jens Axboe <axboe@...nel.dk>,
syzbot <syzbot+092bbab7da235a02a03a@...kaller.appspotmail.com>,
asml.silence@...il.com, io-uring@...r.kernel.org,
linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [syzbot] [io-uring?] KASAN: null-ptr-deref Write in sys_io_uring_register
On Wed, Dec 4, 2024 at 11:30 AM Tamir Duberstein <tamird@...il.com> wrote:
>
> On Wed, Dec 4, 2024 at 11:25 AM Matthew Wilcox <willy@...radead.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.
Is there anything I can do to help with this?
> > ... 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.
Matthew, would you consider a patch that migrates the xarray tests to kunit?
Powered by blists - more mailing lists