lkml.org 
[lkml]   [2016]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sg_io HARDENED_USERCOPY_PAGESPAN trace
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

\
 
 \ /
  Last update: 2016-12-30 16:02    [W:0.052 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site