From: Kees Cook <keescook@chromium.org>
To: Christoph Hellwig <hch@lst.de>
Cc: kernel test robot <oliver.sang@intel.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Bart Van Assche <bvanassche@acm.org>,
John Garry <john.garry@huawei.com>,
LKML <linux-kernel@vger.kernel.org>,
lkp@lists.01.org, lkp@intel.com,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
linux-mm@kvack.org, linux-hardening@vger.kernel.org
Subject: Re: [scsi] 6aded12b10: kernel_BUG_at_mm/usercopy.c
Date: Wed, 23 Mar 2022 15:33:30 -0700 [thread overview]
Message-ID: <202203231531.02D8297F77@keescook> (raw)
In-Reply-To: <20220323154739.GA816@lst.de>
On Wed, Mar 23, 2022 at 04:47:39PM +0100, Christoph Hellwig wrote:
> On Wed, Mar 23, 2022 at 08:40:30AM -0700, Kees Cook wrote:
> > Regardless, I'm concerned that disabling PAGESPAN will just uncover
> > further checks, though. Where is allocation happening? The check is here:
>
> blk_mq_alloc_rqs, using alloc_pages_node. This hasn't actually changed
> with this comment. Just the size of the allocation shrunk, probably
> leading to the span of pages.
Okay, the page allocator _should_ be fine for that. In the mean time,
lkp should probably just disable PAGESPAN.
> > I *think* the allocation is happening in scsi_ioctl_reset()? But that's
> > a plain kmalloc(), so I'm not sure why PAGESPAN would have tripped...
> > are there other allocation paths?
>
> scsi_ioctl_reset is the odd one out and does also allocate a request,
> but that request is never used for user copies (and that whole hacky
> side path needs to go away, there is a huge series that needs to be
> finished to sort this out).
Gotcha!
--
Kees Cook
WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook@chromium.org>
To: lkp@lists.01.org
Subject: Re: [scsi] 6aded12b10: kernel_BUG_at_mm/usercopy.c
Date: Wed, 23 Mar 2022 15:33:30 -0700 [thread overview]
Message-ID: <202203231531.02D8297F77@keescook> (raw)
In-Reply-To: <20220323154739.GA816@lst.de>
[-- Attachment #1: Type: text/plain, Size: 1054 bytes --]
On Wed, Mar 23, 2022 at 04:47:39PM +0100, Christoph Hellwig wrote:
> On Wed, Mar 23, 2022 at 08:40:30AM -0700, Kees Cook wrote:
> > Regardless, I'm concerned that disabling PAGESPAN will just uncover
> > further checks, though. Where is allocation happening? The check is here:
>
> blk_mq_alloc_rqs, using alloc_pages_node. This hasn't actually changed
> with this comment. Just the size of the allocation shrunk, probably
> leading to the span of pages.
Okay, the page allocator _should_ be fine for that. In the mean time,
lkp should probably just disable PAGESPAN.
> > I *think* the allocation is happening in scsi_ioctl_reset()? But that's
> > a plain kmalloc(), so I'm not sure why PAGESPAN would have tripped...
> > are there other allocation paths?
>
> scsi_ioctl_reset is the odd one out and does also allocate a request,
> but that request is never used for user copies (and that whole hacky
> side path needs to go away, there is a huge series that needs to be
> finished to sort this out).
Gotcha!
--
Kees Cook
next prev parent reply other threads:[~2022-03-23 22:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-20 14:34 [scsi] 6aded12b10: kernel_BUG_at_mm/usercopy.c kernel test robot
2022-03-20 14:34 ` kernel test robot
2022-03-23 7:14 ` Christoph Hellwig
2022-03-23 7:14 ` Christoph Hellwig
2022-03-23 15:40 ` Kees Cook
2022-03-23 15:40 ` Kees Cook
2022-03-23 15:42 ` Matthew Wilcox
2022-03-23 15:42 ` Matthew Wilcox
2022-03-23 22:30 ` Kees Cook
2022-03-23 22:30 ` Kees Cook
2022-03-23 15:47 ` Christoph Hellwig
2022-03-23 15:47 ` Christoph Hellwig
2022-03-23 22:33 ` Kees Cook [this message]
2022-03-23 22:33 ` Kees Cook
2022-03-24 6:48 ` Christoph Hellwig
2022-03-24 6:48 ` Christoph Hellwig
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=202203231531.02D8297F77@keescook \
--to=keescook@chromium.org \
--cc=bvanassche@acm.org \
--cc=hch@lst.de \
--cc=john.garry@huawei.com \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=lkp@lists.01.org \
--cc=martin.petersen@oracle.com \
--cc=oliver.sang@intel.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 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.