Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3782718ybi; Mon, 29 Jul 2019 12:31:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBVpOQ3Mmbr/PI/9VE5/BDuEzBParfINao0VLsAAz0DTsT3N1e933A3hzzf8ojIwPyKuDd X-Received: by 2002:a62:b411:: with SMTP id h17mr36555633pfn.99.1564428719661; Mon, 29 Jul 2019 12:31:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564428719; cv=none; d=google.com; s=arc-20160816; b=JM6HVCFHe5QkbhuPmjBuLVDJU+tZRoVSBQgvgauQDqRP8mJbuel5TnFK3Cxl0SkGKa 0lXDJppGMl9jImeM4O4Zwn84kI87bbDTa584CFc+JgnPMjP/Dbb+NNwXRr2uCV1EENtS +7E2KSGDXdks5KzP8YC7AlPA0ZiTx2f8ezSQ7cBtCJbv6xKWyavVQVGteNN8MS+rEmk1 KN9JW3CslheOaqJ2M0OQLnPACkc0Zwl1OcTJK6A9AAZuSTp2ekfMYSYkaLf7exhsrI/U CRK88XtxDD75+LX7QEuDCj08LZ8PRomdYQs1tp+m/cO6U5hAtiZux1YtBeJJm7MvdQxW 3PhA== 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=YwNorPphJG4cyY7lj8Ua4yfIzphPmz7Skue57y6iZFI=; b=vCNKwnu+2pn/V4/izh1luNhgdDcv3Ny6JRDmyRjXyFRKBay3DT04LHANWVTrs0D+hb xytxITzTYZv0D9Mj1C2RZo3/xZ/n9RT/SKpEnzWLN1i7hmHLe09RqXv5+vQ0GdXYNrsS o41o6S7X9LrtNgaLQsty8DXchmewQVDlMMP1yW3ZQ6fvFZKRG3taj7ZtTIdB6X1lE/Ty 6gWJreoe7VRb4aO3jyLxdm/HlQDcRu+EVcvGsnmNC2rq4zoxhw96jEjWKWbW3Dx7+NS9 clpEQbAKjrOo06XL89B187pP/fg3hB5TAVTZaSKL11NiVP1VHlx3/OsdPzKn7GeRYIQL nTvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bbUR1AKJ; 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 l24si30770783pff.66.2019.07.29.12.31.44; Mon, 29 Jul 2019 12:31:59 -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=bbUR1AKJ; 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 S1729547AbfG2TYw (ORCPT + 99 others); Mon, 29 Jul 2019 15:24:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:37062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388261AbfG2TYt (ORCPT ); Mon, 29 Jul 2019 15:24:49 -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 2C13F2070B; Mon, 29 Jul 2019 19:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428288; bh=Ire5g8j7iE8F2i2K4gIHA5JJB8poiWFOp1vz2FsF8wM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bbUR1AKJaV0aDVEa05Y+1+NdEFKK3m/2Z/u2cgy0E2faq1bbbEp8mexqSdVxLinm7 EDz1LNLao8CtEgqFW5BTTvl3H9QxTMPDyvuX7D6LV6rIWQZTLi2uxzoSXGmR9yBJbC X7fkjg6xz7JquM4GMzkgC3kpW8/BsP2APFoGxV/4= 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.14 029/293] crypto: talitos - Align SEC1 accesses to 32 bits boundaries. Date: Mon, 29 Jul 2019 21:18:40 +0200 Message-Id: <20190729190823.964781137@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@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 62dca638105d..a0cd4f6085d0 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -3119,7 +3119,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