Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp459652ybl; Tue, 28 Jan 2020 06:18:47 -0800 (PST) X-Google-Smtp-Source: APXvYqzYYgLh38ez3d+HoCwyAxltx7KYC6VGc4KFVoqh1W6knke2v1fZQhNUcP65jEeAY70JPlYP X-Received: by 2002:a9d:268:: with SMTP id 95mr16111768otb.183.1580221127739; Tue, 28 Jan 2020 06:18:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580221127; cv=none; d=google.com; s=arc-20160816; b=VeSlXoDqC7Kx7QZ73uJYjpxCFdwZqLR2W/DSzpHuPwiUXGIWk3gYhaNrctoVgqoNT8 UEfh9ThVMBqT57p4lfzxrfBpWRtY15JHekyCVxAYTjKmYOHuuq2kw15Pxaov0OaNQXD4 OVuCRlGpJj2SDHlsXC7HtqqXNCGUDODdGeZ+guFScfGPaRnBYV75V/+esWAT3dua/VpS EhTwiBTjr4RyGLlb0rvPrKEPc7fddaR5KinZ+2EqEro8Ta4+tQQFcEdAedStzbvFZnC/ E2tMkev5QSs1QYKvlFsImgCC4Svsu2+QDbXC4iV8pOTM6xIjdYR9bQocICgO/Ruv4CIx ygQQ== 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=7dQW252pAitxvNltTXj/FOVoYSPvQ1DntZvh+WpbXd8=; b=IOnqesuqqM1P3Z2Ux4F8yVagPMYbIFUyf/qv0lriTDlAvgM96BF7sVCZ1sVieqNKq6 1+cRkCRtWAUWseyS4g1cqcFkgd/mLDmbEo2I1/S5H2XsVzC3E8pZsKwYeOEPq48n5qt4 +zHv9nmB4nmduEzoyqvBXYbXWxClkYozjhX42G7jATclVN4bUHcbgPYiHRTIcCCHQwhl FQjPH/GYTR9pACSxw/+E0RL4Q5MAXi5BTOzbpB9lXc1tD9FMhOIK9D4tMT46kpKengKO iYt5fA/J9YXsqSc9GYf31UU/TqdP8GA9O7IWTIwddd2NqpKpprOxjEdyG6Pm/lz8uDO1 o6wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K0x439QP; 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 c10si8311389otr.88.2020.01.28.06.18.35; Tue, 28 Jan 2020 06:18:47 -0800 (PST) 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=K0x439QP; 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 S1730312AbgA1OQb (ORCPT + 99 others); Tue, 28 Jan 2020 09:16:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:39852 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727179AbgA1OQ2 (ORCPT ); Tue, 28 Jan 2020 09:16:28 -0500 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 3CB402468D; Tue, 28 Jan 2020 14:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580220987; bh=FjKs7kj1QyIdMdGW6JMz6tb12uo0pJoik3pgWS1XT2M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K0x439QPpLzilx/dUO5gxIGSxihv5C8MmqXrQJj96RViYamCE30xLg8BsF5E2qBPO mDaNUqWOJzYyARjtC21RJKKhIX1o5MB3V4/j2WYGL8yyeYnarwnXgZcTa7cAD+Lzaa kADePgO7qb8k/uCEpcU4h3Brw0E7/a/e9JYKWjuM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Biggers , Herbert Xu , Sasha Levin Subject: [PATCH 4.9 044/271] crypto: tgr192 - fix unaligned memory access Date: Tue, 28 Jan 2020 15:03:13 +0100 Message-Id: <20200128135855.930739000@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@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 [ Upstream commit f990f7fb58ac8ac9a43316f09a48cff1a49dda42 ] Fix an unaligned memory access in tgr192_transform() by using the unaligned access helpers. Fixes: 06ace7a9bafe ("[CRYPTO] Use standard byte order macros wherever possible") Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- crypto/tgr192.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/tgr192.c b/crypto/tgr192.c index 321bc6ff2a9d1..904c8444aa0a2 100644 --- a/crypto/tgr192.c +++ b/crypto/tgr192.c @@ -25,8 +25,9 @@ #include #include #include -#include #include +#include +#include #define TGR192_DIGEST_SIZE 24 #define TGR160_DIGEST_SIZE 20 @@ -468,10 +469,9 @@ static void tgr192_transform(struct tgr192_ctx *tctx, const u8 * data) u64 a, b, c, aa, bb, cc; u64 x[8]; int i; - const __le64 *ptr = (const __le64 *)data; for (i = 0; i < 8; i++) - x[i] = le64_to_cpu(ptr[i]); + x[i] = get_unaligned_le64(data + i * sizeof(__le64)); /* save */ a = aa = tctx->a; -- 2.20.1