Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2991344imu; Sun, 9 Dec 2018 14:29:33 -0800 (PST) X-Google-Smtp-Source: AFSGD/W1cPmG/wwxWKCdQb3CrS/WHQrF8+PKy1F/QIwYDUcHLY9Vy4816pHUTldOp6dB8hT89vK7 X-Received: by 2002:a62:442:: with SMTP id 63mr9964761pfe.156.1544394573334; Sun, 09 Dec 2018 14:29:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544394573; cv=none; d=google.com; s=arc-20160816; b=ZcV5hsrp2sKbTIaeU8ouni3C9GIpkAxPW8L45pWkUqnav0O47rfVOuGng59RdAvuFR faQgWFlticsAe2dVnlLEXY8Uoz07w6Z/Gk2EYvvOu5zXkiSHQkPyaLP+XX/196BvTlH1 u/3rukyf2q2MTJ3bDW05heGfOJX67w200551Ko5lIUXu9fwW4FkW15+ps66mRo5ahQBU G5RppDqMqYvaVBrf0998BzBgPcOw4YQitiJumTus4dcuDOyGfazgpznHz8/mHSw9Vs/N lOSlxAMGNook/4cDSg8wHZKUm+tdQGnk0g0T+qoTxTx1VH1h2MSOQYpBvccWIw9hy150 PsVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=SQ4ugJwHrWBFwbbgjsmJ1cxivoiHEH2DKRg6Zktx0cY=; b=06h81YveLRBJSdF8o8+f6n/3vF3Yq8av8EUZ5dowrSqgzAYA96DTszJe/3u4f2Yy0J CIG0ts3TD1jaMAE0uV/jLlWkisp7LK/pdKozfeT/mS120mlB1NzoFt3D+P+PMrlzTv+n QrRlqpSnnGlzv1Vw1gOGJ2IMSgeOxluin3+PIshvcKd1P+bpNNNaPA9thqD7O76WH6Tf VKQBvWYWgDaHKcvrY0BF9ID3vFdRKSSGIGqdLMdfPbCyQAovzD+fGSH4rY8jTQ8CDlcA QuCRSwPg8msD6GbucnLky+JCx4JbvRlco8opbyHH7fFo3CSzKZct2UvrBUcpHCDpkUIb hwqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 g12si8024697pgd.567.2018.12.09.14.29.18; Sun, 09 Dec 2018 14:29:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728855AbeLIW2B (ORCPT + 99 others); Sun, 9 Dec 2018 17:28:01 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:34616 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726365AbeLIVzL (ORCPT ); Sun, 9 Dec 2018 16:55:11 -0500 Received: from pub.yeoldevic.com ([81.174.156.145] helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gW72Y-0002in-RH; Sun, 09 Dec 2018 21:55:06 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gW72Y-0003DI-7Z; Sun, 09 Dec 2018 21:55:06 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Eric Biggers" , "Herbert Xu" Date: Sun, 09 Dec 2018 21:50:33 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 015/328] crypto: vmac - require a block cipher with 128-bit block size In-Reply-To: X-SA-Exim-Connect-IP: 81.174.156.145 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.62-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Eric Biggers commit 73bf20ef3df262026c3470241ae4ac8196943ffa upstream. The VMAC template assumes the block cipher has a 128-bit block size, but it failed to check for that. Thus it was possible to instantiate it using a 64-bit block size cipher, e.g. "vmac(cast5)", causing uninitialized memory to be used. Add the needed check when instantiating the template. Fixes: f1939f7c5645 ("crypto: vmac - New hash algorithm for intel_txt support") Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu Signed-off-by: Ben Hutchings --- crypto/vmac.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/crypto/vmac.c +++ b/crypto/vmac.c @@ -655,6 +655,10 @@ static int vmac_create(struct crypto_tem if (IS_ERR(alg)) return PTR_ERR(alg); + err = -EINVAL; + if (alg->cra_blocksize != 16) + goto out_put_alg; + inst = shash_alloc_instance("vmac", alg); err = PTR_ERR(inst); if (IS_ERR(inst))