Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1548634
| From | Dave Jones <davej@codemonkey.org.uk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: sg_io HARDENED_USERCOPY_PAGESPAN trace |
| Date | 2016-12-30 16:10 +0100 |
| Message-ID | <sU6YF-5Yf-5@gated-at.bofh.it> (permalink) |
| References | <sTugG-5Ko-11@gated-at.bofh.it> <sTDMZ-3Kv-5@gated-at.bofh.it> <sTL7Q-8pB-19@gated-at.bofh.it> <sU5zA-4WJ-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Dec 30, 2016 at 05:37:12AM -0800, Christoph Hellwig wrote:
> On Thu, Dec 29, 2016 at 10:43:51AM -0500, Dave Jones wrote:
> > On Wed, Dec 28, 2016 at 11:56:42PM -0800, Christoph Hellwig wrote:
> > > On Wed, Dec 28, 2016 at 04:40:16PM -0500, Dave Jones wrote:
> > > > sg_io+0x113/0x470
> > >
> > > Can you resolve that to a source line using a gdb?
> >
> > It's the copy_from_user in an inlined copy of blk_fill_sghdr_rq.
>
> That must be this line right at the beginning of blk_fill_sghdr_rq
>
> if (copy_from_user(rq->cmd, hdr->cmdp, hdr->cmd_len))
> return -EFAULT;
>
> We're copying the SCSI CDB from the userspace pointer inside the hdr
> we copied earlier into the request.
>
> req->cmd is set to req->__cmd which is a u8 array with 16 members in
> struct request by default, but if hdr->cmd_len is bigger than BLK_MAX_CDB
> (16) we do a separate allocation for it in the caller:
>
> if (hdr->cmd_len > BLK_MAX_CDB) {
> rq->cmd = kzalloc(hdr->cmd_len, GFP_KERNEL);
> if (!rq->cmd)
> goto out_put_request;
> }
>
> so I'm not really sure what the problem here could be.
I threw this debug printk into the pagespan code to see what exactly
it was complaining about..
ptr:ffff88042614cff8 end:ffff88042614d003 n:c
so it was copying 12 bytes that spanned two pages.
From my reading of the config option help text, this thing is
complaining that wasn't allocated with __GFP_COMP maybe ?
Dave
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
sg_io HARDENED_USERCOPY_PAGESPAN trace Dave Jones <davej@codemonkey.org.uk> - 2016-12-28 22:50 +0100
Re: sg_io HARDENED_USERCOPY_PAGESPAN trace Dave Jones <davej@codemonkey.org.uk> - 2016-12-29 16:50 +0100
Re: sg_io HARDENED_USERCOPY_PAGESPAN trace Christoph Hellwig <hch@infradead.org> - 2016-12-30 14:40 +0100
Re: sg_io HARDENED_USERCOPY_PAGESPAN trace Dave Jones <davej@codemonkey.org.uk> - 2016-12-30 16:10 +0100
Re: sg_io HARDENED_USERCOPY_PAGESPAN trace Christoph Hellwig <hch@infradead.org> - 2016-12-30 16:20 +0100
Re: sg_io HARDENED_USERCOPY_PAGESPAN trace Christoph Hellwig <hch@infradead.org> - 2016-12-29 09:00 +0100
csiph-web