Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp632290iog; Mon, 13 Jun 2022 09:31:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOU+0urZJi2UN6kFGfWdVLbTXhduavxU8WGVywaDS8tGwjUvoOOz3D3eV68iMafyEdIYWz X-Received: by 2002:a17:90a:df16:b0:1e3:1cd:6c6f with SMTP id gp22-20020a17090adf1600b001e301cd6c6fmr16935171pjb.10.1655137899621; Mon, 13 Jun 2022 09:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655137899; cv=none; d=google.com; s=arc-20160816; b=mzAH27wojm0CYuZrt1IUAwDybwacMzEoZJOsQF/jG8bg+yb/2owkgHL39y5aKdikkL Uyys25RNThfFhrCtvuKbNOPdUj/pJvgPRLF0cPvfaknEJ2NKnDGQITEx10ZnDYjEBVDW V1g7u9wQfog+LlBfdfU4s4RXPESGhCBWa7WFqDTc0/jO1xw/RoYu1RUO3Yd6yk+0yjvl vQCKG13+YgmpmGfsB5xmOdj6iMfHaDcX6NLImpw1NeFe7uf2YnzNYGRf6DktrFAHC0ki HeQqk9grizv5nsRc/g1QNA6LMZF67MAea/mXcKvw67PRNosgWEqc31kpI7V5kc/xyxNt 7YeA== 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=vWLpI1EwfCzSV5UGRh6YhiD1RzTUKfEZok99LYUrXH8=; b=pgokg/ULcndUWxQh5uThcWAV4OHyO/tVIqS8hE0WelzREV69At4pjn4cH+XyeBFT59 +/ZMK+ahkADjm3NSvUxKQGbWabhDrDxvyFupr08orVCIIOKvjNmUc/6nNItnImeCGNl/ scZ1FTqoZu8p5KYJTZOhQW/x9o2CxnNwAWjjTzoCHC0pjwbjp0+/Tm0GGnt24bj58Uj9 xv7ouTb5ZDDzliG4NIUpn7JNvG/zorUON2/t6BHL0Zq+N7pTyHVqjFKjbOOq/RB+1RoQ 9SReOlL0OltUbbbtD2uDiKulKIAJ7fKAz0+SbRA8t5iNn7tWjN2b5SsuN8AT+bzesryL rFmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=r4gCekdv; 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 n2-20020a634d42000000b0040014afa1efsi10399984pgl.337.2022.06.13.09.31.28; Mon, 13 Jun 2022 09:31:39 -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=r4gCekdv; 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 S1354388AbiFMLjw (ORCPT + 99 others); Mon, 13 Jun 2022 07:39:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355171AbiFMLav (ORCPT ); Mon, 13 Jun 2022 07:30:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16F0B2B242; Mon, 13 Jun 2022 03:46:43 -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 dfw.source.kernel.org (Postfix) with ESMTPS id A797061248; Mon, 13 Jun 2022 10:46:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2A48C34114; Mon, 13 Jun 2022 10:46:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655117202; bh=3z2h9TsGGV1nv2mizR5ga4PJZxa8jkuUU08Q/9Kx23Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r4gCekdv5Z8HFjpCuq4d7Eu67Kzjn5Q/8Iz5tfW0h2yzEBO+lf9NdjR2EEfhuwXca S9VVC9HSxVPAHqlKK3PnABwCpOXLtpCyk6qidlp2eoFEe/Blt02Dy+UlUtwe3D63nv 4t8WtNhhDhfX5d8hgpU1Q2Nr3lwt61Z3MM8tMt9c= 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 5.4 322/411] s390/crypto: fix scatterwalk_unmap() callers in AES-GCM Date: Mon, 13 Jun 2022 12:09:55 +0200 Message-Id: <20220613094938.388822493@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@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 9803e96d2924..558cfe570ccf 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