Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10408087ybi; Wed, 24 Jul 2019 22:40:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyH9ZLa93RY4zcfUr+7YaPVEQP2Yd2MO01+pNKcCFhKXo1niOUmb6Wo2Zd4LQhfZBN1Zpwn X-Received: by 2002:a62:7990:: with SMTP id u138mr14302765pfc.191.1564033243488; Wed, 24 Jul 2019 22:40:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564033243; cv=none; d=google.com; s=arc-20160816; b=lWlGUaFiMDWJw4XC6ZG7prz/v990K8i+KPsYD636XXFwyZsuQaGEfNHMGSYv85zRZY pBW3E3IngOwbjbZqE0/+IF3ZqakxOVryRbvq8dKqWwMZw6ZuJ93NXhqo8q6QnfvVPPJD 1aODaYwGildRZ2ExIjGNaFb9/kfYIPdFxxvSxmasjmSxPX2OlxNBjwBZKH80mtHJAZ5Q ZBv3hylqqVhXg8y/pgA4Wx1NRlZBlnOrnIIM3QCHHLtjZl7+KX/dMmTi2GaavEXLR1Xo j/rZf22jInNVmhwlfzwvm1RQpyF7pUr/5GmkW+W3+vI5/DGKeK4Qb92+D+Pckzx3p7fp fgvQ== 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=mHZDQAD+ply7zbl29ST8gw04pkb5qxeoLddf0n2Qs+w=; b=BrFVrr5zIt/P+mdg0BEemtuO1usgjhuGHzKfyRKUp7ZEKWjgAJc1W2wS1KY4p77kbn vxWj84Uh20DYvGERLghcjma1DsHAZAWPnGVIGCTbweLg9rrL9qHgdF3KS22G17+UpSwT EbK8aHp0ubKENGvWo1CboHqRnxG+qhgZSdWtopMBm2BUVDso2e3J/W0Tbmw2XkB9xptT puWeHJlRz5+BVWLGipUE4fxCsZDgfiU7tv0V0aPD20QUnDYs+kFt+LKSfoIo3btRwrGm lmvR7syOAu3g19TmVLf45y58eJJ9wKDUnYih7t6n9LVKCN9r9OOpwGz1p9qYqiG5Bz3h SdLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FCEjR4u4; 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 h4si17593798plt.30.2019.07.24.22.40.28; Wed, 24 Jul 2019 22:40:43 -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=FCEjR4u4; 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 S2405579AbfGXUCq (ORCPT + 99 others); Wed, 24 Jul 2019 16:02:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:52726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404679AbfGXUCp (ORCPT ); Wed, 24 Jul 2019 16:02:45 -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 00FF2205C9; Wed, 24 Jul 2019 20:02:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563998564; bh=UWE2DN4Cd8hLRQMDE57ZxB+Xn521+jVhFIUc94A+9zc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FCEjR4u4TsC8cy5Xb9ypSXV/5TDHkfQuvxkAYUm23EUnD50vLoUyYgOonG/ZM3dWx QX3THGHAlwJjoNvvdYYf6PTMuPaIahmwQcVhpEciyf7MB8Za9rGQh4qUfqazeeGJgD QxGFu9fYDByp99Hq8w1Olz84ICuqKfXyiB2jDNV0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , Herbert Xu , Sasha Levin Subject: [PATCH 4.19 036/271] crypto: talitos - Align SEC1 accesses to 32 bits boundaries. Date: Wed, 24 Jul 2019 21:18:25 +0200 Message-Id: <20190724191658.293730178@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@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 [ Upstream commit c9cca7034b34a2d82e9a03b757de2485c294851c ] The MPC885 reference manual states: SEC Lite-initiated 8xx writes can occur only on 32-bit-word boundaries, but reads can occur on any byte boundary. Writing back a header read from a non-32-bit-word boundary will yield unpredictable results. In order to ensure that, cra_alignmask is set to 3 for SEC1. Signed-off-by: Christophe Leroy Fixes: 9c4a79653b35 ("crypto: talitos - Freescale integrated security engine (SEC) driver") Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/talitos.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 254f711f1934..41b288bdcdbf 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -3193,7 +3193,10 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev, alg->cra_priority = t_alg->algt.priority; else alg->cra_priority = TALITOS_CRA_PRIORITY; - alg->cra_alignmask = 0; + if (has_ftr_sec1(priv)) + alg->cra_alignmask = 3; + else + alg->cra_alignmask = 0; alg->cra_ctxsize = sizeof(struct talitos_ctx); alg->cra_flags |= CRYPTO_ALG_KERN_DRIVER_ONLY; -- 2.20.1