Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp630218ybi; Fri, 2 Aug 2019 01:39:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnQRsS9dqHlrF/x6iDwXXa/0Yghd86TN+cf1P40nrlVCtF7szgD109/kvTpWiwGA534Wwf X-Received: by 2002:a65:4489:: with SMTP id l9mr126940838pgq.207.1564735159336; Fri, 02 Aug 2019 01:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564735159; cv=none; d=google.com; s=arc-20160816; b=bYqAg9hVpn5K1zZKUVDkqT0Af2hYO4DWhPs+BvRnGo2ToA1UdYL/yFVFteEHgkbcAG ekAfuwUTZUpawLVn1qsnhcHd+yztPXz9YEfsFwRPrOx9or1j5IlXotZvbHhGOijt+ULk 2G//3kh+by2vRZI+BqzGmD8VrXcV0I8hWFKlwACgAA3xwRpKUNV4GHePcHw1UR6L3zgq hhrJgTRru+qaNapbu2BPJ4yRPosvMGYYS3BUVa+C/VOWDsXhrxCwUXf+uRMMBIoKSbdE 8bg6R6U4PYhATQMVO3tkRIDfDzrcoSpSHFiUKkzOVgj1YKWAkqKas6XCddPVmRoMw+EH u+Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=5r4WF0EzpxAIcJM92w3zZQnOhoH1iaBPJ4Fy8BA+f4k=; b=xuFOJelx7QewcQB9LX4u6eUkqbkpdEYJ9WgtB1m2KKZl2jQtiJYd/kYS7tscRCjoyC c1BK5gEpIPTWYrlez8I7+C67WALVNk0tObq4gLaKRy2hzMBjjthlTFHiX5vHImVlgXVQ VVCDz+3UF4iq44VoUAM+77brxKTgXIFIrK1YsO71NXAMRgxNk/nUDR6e4cRacQJ31U+L JtcmvyNesnl8iyJ834s5KEYnh4pCwgERIaDTXxNLWj+YEy9gOjBi08qNTKjwmQQwqbvB PzEcWJif2HGN7dlC7Hiy4Dl7ETLee6VzahyVkMR63DhLHHE8YxisBzBGSIvivSV0j5jD enGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p16si37727838pgh.410.2019.08.02.01.39.04; Fri, 02 Aug 2019 01:39:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729201AbfHBEBy (ORCPT + 99 others); Fri, 2 Aug 2019 00:01:54 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:48452 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725787AbfHBEBy (ORCPT ); Fri, 2 Aug 2019 00:01:54 -0400 Received: from gondolin.me.apana.org.au ([192.168.0.6] helo=gondolin.hengli.com.au) by fornost.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1htOlM-0005C3-8c; Fri, 02 Aug 2019 14:01:52 +1000 Received: from herbert by gondolin.hengli.com.au with local (Exim 4.80) (envelope-from ) id 1htOlI-000499-W5; Fri, 02 Aug 2019 14:01:48 +1000 Date: Fri, 2 Aug 2019 14:01:48 +1000 From: Herbert Xu To: Iuliana Prodan Cc: "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx Subject: Re: [PATCH v4] crypto: gcm - restrict assoclen for rfc4543 Message-ID: <20190802040148.GA15907@gondor.apana.org.au> References: <1564504233-26186-1-git-send-email-iuliana.prodan@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1564504233-26186-1-git-send-email-iuliana.prodan@nxp.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Jul 30, 2019 at 07:30:33PM +0300, Iuliana Prodan wrote: > > diff --git a/crypto/gcm.c b/crypto/gcm.c > index 2f3b50f..8adf64f 100644 > --- a/crypto/gcm.c > +++ b/crypto/gcm.c > @@ -1034,12 +1034,14 @@ static int crypto_rfc4543_copy_src_to_dst(struct aead_request *req, bool enc) > > static int crypto_rfc4543_encrypt(struct aead_request *req) > { > - return crypto_rfc4543_crypt(req, true); > + return crypto_ipsec_check_assoclen(req->assoclen) ?: > + crypto_rfc4543_crypt(req, true); Please align it like this: return crypto_ipsec_check_assoclen(req->assoclen) ?: crypto_rfc4543_crypt(req, true); as that's how everything else is aligned in crypto. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt