All of lore.kernel.org
 help / color / mirror / Atom feed
From: hch <hch@lst.de>
To: Stephan Wurm <stephan.wurm@a-eberle.de>
Cc: hch <hch@lst.de>, Richard Weinberger <richard@nod.at>,
	linux-block <linux-block@vger.kernel.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-mtd <linux-mtd@lists.infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Johannes Eigner <johannes.eigner@a-eberle.de>
Subject: Re: ubiblock: null pointer dereference using scatterlist in work_queue
Date: Wed, 9 Aug 2023 16:15:42 +0200	[thread overview]
Message-ID: <20230809141542.GA32614@lst.de> (raw)
In-Reply-To: <ZNOec8JmndA63Mnh@PC-LX-Wurm>

On Wed, Aug 09, 2023 at 04:10:59PM +0200, Stephan Wurm wrote:
> Am 09. Aug 15:53 hat hch geschrieben:
> > Well, a scatterlist culd contain a highmem page, in which case sg_virt
> > isn't going to cut it and you need to kmap.  Is this a 32-bit system
> > with highmem enabled?
> I can confirm it is a 32-bit system with highmem enabled.

Yes.  So the code needs to stop using sg_virt to work on highmem
setups and do the equivalent of scsi_kmap_atomic_sg.  Best way
forward is probably to move scsi_kmap_atomic_sg to lib/scatterlist.c
(and also convert it to kmap_local instead of kmap_atomic while you're
at it) and then use that in ubiblock

WARNING: multiple messages have this Message-ID (diff)
From: hch <hch@lst.de>
To: Stephan Wurm <stephan.wurm@a-eberle.de>
Cc: hch <hch@lst.de>, Richard Weinberger <richard@nod.at>,
	linux-block <linux-block@vger.kernel.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-mtd <linux-mtd@lists.infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Johannes Eigner <johannes.eigner@a-eberle.de>
Subject: Re: ubiblock: null pointer dereference using scatterlist in work_queue
Date: Wed, 9 Aug 2023 16:15:42 +0200	[thread overview]
Message-ID: <20230809141542.GA32614@lst.de> (raw)
In-Reply-To: <ZNOec8JmndA63Mnh@PC-LX-Wurm>

On Wed, Aug 09, 2023 at 04:10:59PM +0200, Stephan Wurm wrote:
> Am 09. Aug 15:53 hat hch geschrieben:
> > Well, a scatterlist culd contain a highmem page, in which case sg_virt
> > isn't going to cut it and you need to kmap.  Is this a 32-bit system
> > with highmem enabled?
> I can confirm it is a 32-bit system with highmem enabled.

Yes.  So the code needs to stop using sg_virt to work on highmem
setups and do the equivalent of scsi_kmap_atomic_sg.  Best way
forward is probably to move scsi_kmap_atomic_sg to lib/scatterlist.c
(and also convert it to kmap_local instead of kmap_atomic while you're
at it) and then use that in ubiblock

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2023-08-09 14:15 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17  8:07 ubiblock: null pointer dereference using scatterlist in work_queue Stephan Wurm
2023-07-17  8:07 ` Stephan Wurm
2023-07-17  9:42 ` Richard Weinberger
2023-07-17  9:42   ` Richard Weinberger
2023-07-17 10:27   ` Stephan Wurm
2023-07-17 10:27     ` Stephan Wurm
2023-07-17 11:03     ` Richard Weinberger
2023-07-17 11:03       ` Richard Weinberger
2023-07-17 14:55       ` Stephan Wurm
2023-07-17 14:55         ` Stephan Wurm
2023-07-17 20:54         ` Richard Weinberger
2023-07-17 20:54           ` Richard Weinberger
2023-07-19 14:31         ` Richard Weinberger
2023-07-19 14:31           ` Richard Weinberger
2023-07-19 14:38           ` Wurm, Stephan
2023-07-19 14:38             ` Wurm, Stephan
2023-07-21  7:41             ` Wurm, Stephan
2023-07-21  7:41               ` Wurm, Stephan
2023-08-07 22:02 ` Richard Weinberger
2023-08-07 22:02   ` Richard Weinberger
2023-08-09 13:53   ` hch
2023-08-09 13:53     ` hch
2023-08-09 14:10     ` Stephan Wurm
2023-08-09 14:10       ` Stephan Wurm
2023-08-09 14:15       ` hch [this message]
2023-08-09 14:15         ` hch
2023-08-09 22:34         ` Richard Weinberger
2023-08-09 22:34           ` Richard Weinberger
2023-08-09 22:37           ` hch
2023-08-09 22:37             ` hch
2023-08-09 22:43             ` Richard Weinberger
2023-08-09 22:43               ` Richard Weinberger
2023-08-10 15:43               ` hch
2023-08-10 15:43                 ` hch

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=20230809141542.GA32614@lst.de \
    --to=hch@lst.de \
    --cc=johannes.eigner@a-eberle.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=stephan.wurm@a-eberle.de \
    --cc=vigneshr@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.