Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753934AbcKUSIT (ORCPT ); Mon, 21 Nov 2016 13:08:19 -0500 Received: from mail-pg0-f51.google.com ([74.125.83.51]:33858 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752580AbcKUSIS (ORCPT ); Mon, 21 Nov 2016 13:08:18 -0500 Date: Mon, 21 Nov 2016 10:08:14 -0800 From: Eric Biggers To: Herbert Xu Cc: Andy Lutomirski , regressions@leemhuis.info, linux-crypto@vger.kernel.org, "linux-kernel@vger.kernel.org" , Andrew Lutomirski Subject: Re: vmalloced stacks and scatterwalk_map_and_copy() Message-ID: <20161121180814.GA30672@google.com> References: <20161103181624.GA63852@google.com> <20161121082619.GA6462@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161121082619.GA6462@gondor.apana.org.au> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1312 Lines: 35 On Mon, Nov 21, 2016 at 04:26:19PM +0800, Herbert Xu wrote: > crypto: scatterwalk - Remove unnecessary aliasing check in map_and_copy > > The aliasing check in map_and_copy is no longer necessary because > the IPsec ESP code no longer provides an IV that points into the > actual request data. As this check is now triggering BUG checks > due to the vmalloced stack code, I'm removing it. > > Reported-by: Eric Biggers > Signed-off-by: Herbert Xu > > diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c > index 52ce17a..c16c94f8 100644 > --- a/crypto/scatterwalk.c > +++ b/crypto/scatterwalk.c > @@ -68,10 +68,6 @@ void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg, > > sg = scatterwalk_ffwd(tmp, sg, start); > > - if (sg_page(sg) == virt_to_page(buf) && > - sg->offset == offset_in_page(buf)) > - return; > - > scatterwalk_start(&walk, sg); > scatterwalk_copychunks(buf, &walk, nbytes, out); > scatterwalk_done(&walk, out, 0); This looks fine to me if you're confident that the aliasing check is indeed no longer necessary. Another idea I had was to replace memcpy() with memmove(). But I don't want to be in a situation where we're stuck with memmove() forever because of users who probably don't even exist. Eric