Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp850494ybi; Fri, 12 Jul 2019 05:41:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxH2lZpd/Z3ZeE9gxQ2TraWiirBv5XvkvnnrYEHuZ31QtOEeVA+3g6UNuaabCpUy3eJBbvl X-Received: by 2002:a17:90a:1b0c:: with SMTP id q12mr11701046pjq.76.1562935301103; Fri, 12 Jul 2019 05:41:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562935301; cv=none; d=google.com; s=arc-20160816; b=PEwZLD3s4C0j2NJuXcIexeuo57xjrWqX7bjRolalXRSx5jRbHzaqou+hm94nKWtycw xMijPNBd6JLW6kXAgMvz9C5wz88ICFqs09rFykLXIG74zuz+H0pbHb323ZHe/aY5qpEy ET03ucUbzrOo6kdNHEP1Lg+s/7cC+3zsNntMfBepXpuXifa5dRuR6+km4gdqFlMuOOFr y9jemdpOmvcZYb1QwzbAic3Hx0fI9bwJnnmYt7o32WPfQWMLy5Daw2aiL8bG9rj8KQp9 Xtx5C5HrmPFK4W9qsBvj76u/+H1x/qN3v4Snd3VlvJ1fDrOPASJdHUHLdHcnhEpC++uS y1tQ== 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=8sEpZNymdjx1kc03EBWN3Kp826OVvhJsyZ2qp308CUc=; b=Wo/labxwtxT91OM7luQNW1sIALWuNohwtmh3hkuPwwkYIKtJ4E0wTGGQyb60vV9o2C HN9XcF4kWjewoDs9SkZ/RVvs63ixyYpwG3x6AtTiWgiuMeCeijVqIAdA7nGU+T6WJLH7 jC9WC8zTmVIiVWZj7G79jggSCw8lwOdgdWq79g14XVPh9FFK2oZWsv+Mr30ayE0TTGTF nkJWdoPNZ724WfWsYib0DGPjjtGdeuCduEfZaiDBum2QAvJk+fBC4zCyYMgvK5rFNtgO a9f/P7yiHeK5PjARVsrWb/a16is0qgReT46TEiWEHVnUD/mEHXWtFFkfux4pooBUcmbB 7d8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NlyRBD2o; 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 z25si7861879pgk.415.2019.07.12.05.41.26; Fri, 12 Jul 2019 05:41:41 -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=NlyRBD2o; 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 S1728296AbfGLMZe (ORCPT + 99 others); Fri, 12 Jul 2019 08:25:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:35610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727624AbfGLMZ3 (ORCPT ); Fri, 12 Jul 2019 08:25:29 -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 A2D8C216B7; Fri, 12 Jul 2019 12:25:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934329; bh=Ise7hNeluUyWS2rzd+m7obAgIjz8DDTBbGfFLWoQ8V4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NlyRBD2oMFWKYxhLVJbMk7QnPfpjM3mFModGIQoA7GihoyAsURXZ0bMD9oXgbRp3E 1/9WnRxS9FOSC5stjlZeA1moWgAmCEIS5SPZ1d1AuNVBDsa13Dpnc/JkYU4QZhTtcF c1U7YrhEiqvWHv39fLucvhgvRd5qCOXeY/SHipic= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ondrej Mosnacek , Eric Biggers , Herbert Xu Subject: [PATCH 5.1 002/138] crypto: lrw - use correct alignmask Date: Fri, 12 Jul 2019 14:17:46 +0200 Message-Id: <20190712121628.831649607@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121628.731888964@linuxfoundation.org> References: <20190712121628.731888964@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 20a0f9761343fba9b25ea46bd3a3e5e533d974f8 upstream. Commit c778f96bf347 ("crypto: lrw - Optimize tweak computation") incorrectly reduced the alignmask of LRW instances from '__alignof__(u64) - 1' to '__alignof__(__be32) - 1'. However, xor_tweak() and setkey() assume that the data and key, respectively, are aligned to 'be128', which has u64 alignment. Fix the alignmask to be at least '__alignof__(be128) - 1'. Fixes: c778f96bf347 ("crypto: lrw - Optimize tweak computation") Cc: # v4.20+ Cc: Ondrej Mosnacek Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- crypto/lrw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/crypto/lrw.c +++ b/crypto/lrw.c @@ -388,7 +388,7 @@ static int create(struct crypto_template inst->alg.base.cra_priority = alg->base.cra_priority; inst->alg.base.cra_blocksize = LRW_BLOCK_SIZE; inst->alg.base.cra_alignmask = alg->base.cra_alignmask | - (__alignof__(__be32) - 1); + (__alignof__(be128) - 1); inst->alg.ivsize = LRW_BLOCK_SIZE; inst->alg.min_keysize = crypto_skcipher_alg_min_keysize(alg) +