Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9928971ybi; Wed, 24 Jul 2019 12:30:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyU+GtGo8p1X4LQg6wEMIFAMYIHNFTLXfLPIbRIYXjJyaeZ8Ftf0zJvkuQ+AgAxe006l/uw X-Received: by 2002:a17:902:be12:: with SMTP id r18mr82963436pls.341.1563996631033; Wed, 24 Jul 2019 12:30:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563996631; cv=none; d=google.com; s=arc-20160816; b=lGKeweZZ9UyC9FvU+PrxpydaXo6CM56oYnaAAvWdU/bhsBk5Sh0hfldaCEryL5ZneC PI+FqxWYso/IlYuJUDcCQ0U9oLJ8EsXslv0HJymo9FScgXM/7OPnDhT/1EZ7f2QszHAO hLopZD6VybKnsJMGwH3MHuAYPx9L+CdKx5tPYWSMxXdYlKoUCPdlU+2y1Zez57gragSo a8gYvcW2lypyAfjMm96pMgALAY8wDf2X5WgeSVsoJgfXNSoCXikLOeK6PYG3Gse1KrTT jRcp4p351INR/8ZYv50Wr//ohprzdwO3JCpy8M3PQZz92DWFk/lVa09UNZTX4ARhaVdg fZbg== 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=ZtIquy5MAzAHeOqoh4IScQeIwzrYVR7gP1ANUcm661U=; b=U7e6YWdW3fPlQHYtjqfprjcane4xm/DC0IC/BZZlKETUPpUhSK9FS9dnD4J0nLJerI Ke9ZxFvplUpSU/lSGjSEN8AtE4bKB/yfVo4GWDrJYrem8+fK0igZoCw3vsFz0tP+ACnI bqZ0JzQMvKQVM4STSx6aLfaXRrSSMolAkxD7XufRs2WNnq7pnPPcW+7O+WLawHPdTOu/ aCgdWsgz/D3lFIbIKLK9+aFpg4eLE5FtcZlUMMB4SVGJgFtx98KEYxWPRe5tGaSnPURB TvOx2V/0MDMHRIFkWUjcazQ1fW43QTwNjqyH8a6Tjn4jYmElWfkdOtWJP18ax3g57nmO kj2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="EFNu/RJ3"; 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 65si18166661pff.220.2019.07.24.12.30.15; Wed, 24 Jul 2019 12:30:31 -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="EFNu/RJ3"; 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 S2387424AbfGXTZT (ORCPT + 99 others); Wed, 24 Jul 2019 15:25:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:42050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726863AbfGXTZS (ORCPT ); Wed, 24 Jul 2019 15:25:18 -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 0D149218EA; Wed, 24 Jul 2019 19:25:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996317; bh=TH5tOUGwbTSMBJ2WNj9OE9I5vYx4avMd/5IYHBqiSsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EFNu/RJ3Vw9wNZHE4kHW5Kg66nMHztqdx4fC+Be9KxHikkMWW1R0kmJHnGLIBB6HQ hK7wb3vCP0+HXF9BN35ZpmO+oJ4k5pbZxYBkvsyXo2ivDZe2rX/KLwtiABWRNlm7ha J0fUk1m68KbK8hrLHz6kt9+Xb2cW0H/ME9vV39T8= 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 5.2 054/413] crypto: talitos - Align SEC1 accesses to 32 bits boundaries. Date: Wed, 24 Jul 2019 21:15:45 +0200 Message-Id: <20190724191739.287587725@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 fb852727ee1a..710e09e28227 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -3261,7 +3261,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