Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp592273iog; Mon, 13 Jun 2022 08:45:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDrBh3nwlFPK5pNQs4GnKJ9T2wtAB9UQs91Hxj2yG7WL+BaKLF48Ty2imFu4zdSnWlz8g2 X-Received: by 2002:a17:907:8a13:b0:707:194c:30df with SMTP id sc19-20020a1709078a1300b00707194c30dfmr441159ejc.154.1655135146857; Mon, 13 Jun 2022 08:45:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655135146; cv=none; d=google.com; s=arc-20160816; b=xuQaq5J4/mQxvrLdvzOhDv423ZnXUErWoRSXuCqkj2ZWNyRBVBff68Pw0tuhid4ItF EhL3/VGR0NjXDbVij4eJC08Wv4Mc4XgqN5XviP/oWnkEXC3xFDsrbOLybONmkgiwOy1o vluUnjGZd0lIc4gaAYVtnBxoW63cT2qVsrJKWz9RaaCSdG0H/ZT9aPt9WqBouRt/of8/ XwEuI9cdhl3JLQ7mwADXmihy/E1wD+5/xuIlrfSN8wdnbvDYfFZgBzGb+nmDtE+ALzpj kFW2AWEJBUUKZJZTtxEwYo2jGitdRNJ4J31ocRlJx7UDM7/Ndt6UhRBfJh83aT9H+pEn Gd7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vNyBSbMlrRUBZUv/12WUurfqdFp5K866AO+byMCnw4A=; b=S/DROVL1OaRvZ2MYpRopCQGTNIP1CmLN7WOihVOJlZlh/lbR6OTgZ03WEPNJyr7OnP YTgMF3xEEUq0UeBBAyCoz6Xu9KEIK7oyAxFsoXpyiQRJ18RSR0ILFP1pVBqsaS2vcSCv z9/+COcUJR8QCRbvDCtNVKMefqJZ5BY5ILuDjKdIBxwrdupGZkIfriYkn45qhT+OMg/U AhHMfYQdkK0/LC8aOyr8znQksnYxzebGPgw3pfhYHbkZfCsqVtYzTTdFm8I5U7T6Yoxl IJ270/azy9bzXUjeXZMY9tVe5rswojA+JXmF5iB6yVtUnVPsS89kUO/udRRqCqncOuGV cvuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="JOcte/iq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n26-20020a17090673da00b0071576ce44fasi6132271ejl.592.2022.06.13.08.45.22; Mon, 13 Jun 2022 08:45:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="JOcte/iq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352988AbiFMMPa (ORCPT + 99 others); Mon, 13 Jun 2022 08:15:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352007AbiFMMLK (ORCPT ); Mon, 13 Jun 2022 08:11:10 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE1745371E; Mon, 13 Jun 2022 04:00:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 885C1B80D31; Mon, 13 Jun 2022 11:00:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E084EC34114; Mon, 13 Jun 2022 11:00:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655118055; bh=65/yejpU7NuGLhnXbSUNFdcZsbzhwZoUOcMDoZzeHIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JOcte/iqvnclSdmUNjbm5zmN7JaGNzE/GQZjKShsT+cCrqdmijCerNyYQPLzWTyJ0 LT13EvahAGXMPQh/65dcEYXENWSWA393Iyz1eZ8Eee9QZNWuVC/0kbNLdzZOQqA2UQ emBcJw8r1/m7xltfuKNoFGbgv97NKYR0wNv7UM7k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jann Horn , Harald Freudenberger , Heiko Carstens , Sasha Levin Subject: [PATCH 4.19 215/287] s390/crypto: fix scatterwalk_unmap() callers in AES-GCM Date: Mon, 13 Jun 2022 12:10:39 +0200 Message-Id: <20220613094930.381845227@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094923.832156175@linuxfoundation.org> References: <20220613094923.832156175@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jann Horn [ Upstream commit bd52cd5e23f134019b23f0c389db0f9a436e4576 ] The argument of scatterwalk_unmap() is supposed to be the void* that was returned by the previous scatterwalk_map() call. The s390 AES-GCM implementation was instead passing the pointer to the struct scatter_walk. This doesn't actually break anything because scatterwalk_unmap() only uses its argument under CONFIG_HIGHMEM and ARCH_HAS_FLUSH_ON_KUNMAP. Fixes: bf7fa038707c ("s390/crypto: add s390 platform specific aes gcm support.") Signed-off-by: Jann Horn Acked-by: Harald Freudenberger Link: https://lore.kernel.org/r/20220517143047.3054498-1-jannh@google.com Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin --- arch/s390/crypto/aes_s390.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c index 2bc189187ed4..c663caf37ba4 100644 --- a/arch/s390/crypto/aes_s390.c +++ b/arch/s390/crypto/aes_s390.c @@ -861,7 +861,7 @@ static inline void _gcm_sg_unmap_and_advance(struct gcm_sg_walk *gw, unsigned int nbytes) { gw->walk_bytes_remain -= nbytes; - scatterwalk_unmap(&gw->walk); + scatterwalk_unmap(gw->walk_ptr); scatterwalk_advance(&gw->walk, nbytes); scatterwalk_done(&gw->walk, 0, gw->walk_bytes_remain); gw->walk_ptr = NULL; @@ -936,7 +936,7 @@ static int gcm_out_walk_go(struct gcm_sg_walk *gw, unsigned int minbytesneeded) goto out; } - scatterwalk_unmap(&gw->walk); + scatterwalk_unmap(gw->walk_ptr); gw->walk_ptr = NULL; gw->ptr = gw->buf; -- 2.35.1