Re: [PATCH] sunrpc: don't pass on-stack memory to sg_set_buf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Oct 25, 2016, at 15:59, Fields Bruce James <bfields@xxxxxxxxxxxx> wrote:
> 
> On Tue, Oct 25, 2016 at 07:34:43PM +0000, Trond Myklebust wrote:
>> 
>>> On Oct 25, 2016, at 14:45, J. Bruce Fields <bfields@xxxxxxxxxxxx> wrote:
>>> 
>>> From: "J. Bruce Fields" <bfields@xxxxxxxxxx>
>>> 
>>> As of ac4e97abce9b "scatterlist: sg_set_buf() argument must be in linear
>>> mapping", sg_set_buf hits a BUG when make_checksum_v2->xdr_process_buf,
>>> among other callers, passes it memory on the stack.
>>> 
>>> We only need a scatterlist to pass this to the crypto code, and it seems
>>> like overkill to require kmalloc'd memory just to encrypt a few bytes,
>>> but for now this seems the best fix.
>>> 
>>> Note many of these callers are in the NFS write paths, so we shouldn't
>>> really be allocating GFP_KERNEL.  But we already have other allocations
>>> in these code paths.  A larger redesign may be necessary to allow
>>> allocations to be done earlier.
>> 
>> NACK…  I agree that there may already be borkage in RPCSEC_GSS-land, but that’s not a reason to be adding to the pile of things that need to be fixed… The allocations that lie in the RPC client’s encode/decode path do need to be GFP_NOFS….
> 
> OK.  Any disadvantage to keeping this patch with just GFP_NOFS
> allocations everywhere that might be in the write path?

It’s what we have to do everywhere else in the RPC client, so I can’t see why it should be a problem.

��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux