Message ID | 20230601082705.102124-3-aleksandr.mikhalitsyn@canonical.com |
---|---|
State | New |
Headers | show |
Series | fix bio_split_to_limits() NULL pointer dereference | expand |
On Thu, Jun 01, 2023 at 10:27:05AM +0200, Alexander Mikhalitsyn wrote: > From: Jens Axboe <axboe@kernel.dk> > > BugLink: https://bugs.launchpad.net/bugs/2020901 Is this a private bug? I can't see it. > > commit 3e9900f3bd7ba30d60f82b162b70a1dffe4e8e24 upstream. ^ You can drop this line, see below. > > The revert of the removal of this driver happened after we fixed up > the split limits for NOWAIT issue, hence it got missed. Ensure that > we check for a NULL bio after splitting, in case it should be retried. > > Marking this as fixing both commits, so that stable backport will do > this correctly. > > Cc: stable@vger.kernel.org > Fixes: 9cea62b2cbab ("block: don't allow splitting of a REQ_NOWAIT bio") > Fixes: 4b83e99ee709 ("Revert "pktcdvd: remove driver."") > Signed-off-by: Jens Axboe <axboe@kernel.dk> > [amikhalitsyn: adjust context bio_split_to_limits -> blk_queue_split] The proper syntax here would be: (backported from 3e9900f3bd7ba30d60f82b162b70a1dffe4e8e24) [amikhalitsyn: adjust context bio_split_to_limits -> blk_queue_split] Or if you don't have to do any change (or very minimal changes): (cherry-picked from 3e9900f3bd7ba30d60f82b162b70a1dffe4e8e24) > Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> > --- -Andrea
On Thu, Jun 1, 2023 at 10:56 AM Andrea Righi <andrea.righi@canonical.com> wrote: > > On Thu, Jun 01, 2023 at 10:27:05AM +0200, Alexander Mikhalitsyn wrote: > > From: Jens Axboe <axboe@kernel.dk> > > > > BugLink: https://bugs.launchpad.net/bugs/2020901 > > Is this a private bug? I can't see it. Ah, yep. We've decided to make it public. > > > > > commit 3e9900f3bd7ba30d60f82b162b70a1dffe4e8e24 upstream. > > ^ You can drop this line, see below. Fixed. > > > > > The revert of the removal of this driver happened after we fixed up > > the split limits for NOWAIT issue, hence it got missed. Ensure that > > we check for a NULL bio after splitting, in case it should be retried. > > > > Marking this as fixing both commits, so that stable backport will do > > this correctly. > > > > Cc: stable@vger.kernel.org > > Fixes: 9cea62b2cbab ("block: don't allow splitting of a REQ_NOWAIT bio") > > Fixes: 4b83e99ee709 ("Revert "pktcdvd: remove driver."") > > Signed-off-by: Jens Axboe <axboe@kernel.dk> > > [amikhalitsyn: adjust context bio_split_to_limits -> blk_queue_split] > > The proper syntax here would be: > > (backported from 3e9900f3bd7ba30d60f82b162b70a1dffe4e8e24) > [amikhalitsyn: adjust context bio_split_to_limits -> blk_queue_split] > > Or if you don't have to do any change (or very minimal changes): > > (cherry-picked from 3e9900f3bd7ba30d60f82b162b70a1dffe4e8e24) Fixed. Thanks, Alex > > > Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> > > --- > > -Andrea
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 789093375344..1988bb05c0c7 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -2400,6 +2400,8 @@ static void pkt_submit_bio(struct bio *bio) struct bio *split; blk_queue_split(&bio); + if (!bio) + return; pkt_dbg(2, pd, "start = %6llx stop = %6llx\n", (unsigned long long)bio->bi_iter.bi_sector,