Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp247709yba; Mon, 20 May 2019 08:05:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxvQ45M2SWdQvz5SlsA+yh4Op+JQbCZQBLv/SH8EhwEsSTetgZcEAESOX5PHM+C8xXeWtzF X-Received: by 2002:a63:2107:: with SMTP id h7mr3574730pgh.330.1558364728238; Mon, 20 May 2019 08:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558364728; cv=none; d=google.com; s=arc-20160816; b=KBhuOIYAHC8cp2NsBn2qS5o6l6G6Ru++t1+xB/dfBcqcloUt8p47kc2Q6z9/Iw1SLH usgxPj3f/WDLrAqd7TMRBcdab7lytwzyxebzWLV/wDfpbtx8n6FvisHbby2vT8F+cM+V 0kMV1Tiz0hLdvqv1xIz1RSBl6rFaXo6lBcpOTKmHeTOA6fhJYMnL5V7DRQPcuxcopHlI Wr4fWwNQxz7Vdm41eMkbUL+yhyNY/Q44sTXvVGbXlzNxBm45V6rIFvHaEjWxnWTUxeKH zStdUNoS3ot9tR8TK1wsZivT6ePHFp4pl3nfH8tVqHAGZ982eBhBlpX693W78YENbWlg X9Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Lo8j8cpJIGb4yaulscqhHr7IAoWdFl3NcwztIOnWnMY=; b=RDhPaXXWSgvl5IF+Gx39t/l0/K6vMRk3OMcLs4SS8gT7kLJ/cnYHWHVuL+IfePLuaJ rwcQpoy4D1s9LThGsgoG9yD10lQdkrwzTFoM8GbI+RG1ZNsdTNftl4ewjG5XuSvabixV GfCSyknohSi9QzxrrVHiDxvsHMSz6W6zQJzLeGJxiyqPrcymQbN37humZS5Eu+GD6cKH 3n2X7cPMVmRBAPTwld7LpUmpMaR106NmO8Wql86h78tRDaMB351fduDlUK6HKkWa0ctb FA8knANPCqKM9rorZgmCWtuI3PG2nURe7KSzqcKKHPUwsqE7hbOEG2uhOX4lajpoT74O MCuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l28Rxt1o; 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 f7si1597256pgv.105.2019.05.20.08.05.13; Mon, 20 May 2019 08:05:28 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=l28Rxt1o; 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 S1727108AbfETMUU (ORCPT + 99 others); Mon, 20 May 2019 08:20:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:33690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387969AbfETMUT (ORCPT ); Mon, 20 May 2019 08:20:19 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 43BC120656; Mon, 20 May 2019 12:20:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558354818; bh=SouYgWQauP5ZFkhFFMqWevfg1i6+eLajnGKQ+6SjZq4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l28Rxt1otr9s43vDW6TEIqQglVMfhFD8iNEdJqtw/GwsHc3DT00CRiPn9INFX9Djy X1FKnBfe69IXzFHbmfKK6GUAMKG7139jPLihzvI+DPLmYsaw6NebZbXiylUqL1hLr3 Oh5H/W2umeSNDH3pkNH8MUktRZGfhcL4oRbCWlOY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Willi , Eric Biggers , Herbert Xu Subject: [PATCH 4.14 17/63] crypto: chacha20poly1305 - set cra_name correctly Date: Mon, 20 May 2019 14:13:56 +0200 Message-Id: <20190520115232.959361482@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115231.137981521@linuxfoundation.org> References: <20190520115231.137981521@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Biggers commit 5e27f38f1f3f45a0c938299c3a34a2d2db77165a upstream. If the rfc7539 template is instantiated with specific implementations, e.g. "rfc7539(chacha20-generic,poly1305-generic)" rather than "rfc7539(chacha20,poly1305)", then the implementation names end up included in the instance's cra_name. This is incorrect because it then prevents all users from allocating "rfc7539(chacha20,poly1305)", if the highest priority implementations of chacha20 and poly1305 were selected. Also, the self-tests aren't run on an instance allocated in this way. Fix it by setting the instance's cra_name from the underlying algorithms' actual cra_names, rather than from the requested names. This matches what other templates do. Fixes: 71ebc4d1b27d ("crypto: chacha20poly1305 - Add a ChaCha20-Poly1305 AEAD construction, RFC7539") Cc: # v4.2+ Cc: Martin Willi Signed-off-by: Eric Biggers Reviewed-by: Martin Willi Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- crypto/chacha20poly1305.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/crypto/chacha20poly1305.c +++ b/crypto/chacha20poly1305.c @@ -647,8 +647,8 @@ static int chachapoly_create(struct cryp err = -ENAMETOOLONG; if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, - "%s(%s,%s)", name, chacha_name, - poly_name) >= CRYPTO_MAX_ALG_NAME) + "%s(%s,%s)", name, chacha->base.cra_name, + poly->cra_name) >= CRYPTO_MAX_ALG_NAME) goto out_drop_chacha; if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s(%s,%s)", name, chacha->base.cra_driver_name,