From nobody Sun Jun 28 09:36:36 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39BF0C433FE for ; Wed, 9 Feb 2022 19:17:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231888AbiBITRu (ORCPT ); Wed, 9 Feb 2022 14:17:50 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:50978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233374AbiBITRj (ORCPT ); Wed, 9 Feb 2022 14:17:39 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C7C5C0DE7D8; Wed, 9 Feb 2022 11:17:34 -0800 (PST) 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 D5ABC61938; Wed, 9 Feb 2022 19:15:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B58E2C340E7; Wed, 9 Feb 2022 19:15:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644434124; bh=doDB2uOge/0eFsvsZ3gymCVqHyVcqN9XDLRmz9p8KJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GvOTk5nlN7hSky5QTEEOI7nfJUuxRjEQHa3y860SMNhXlROhdrRIpr6H86k0idhm3 Vc/L6clnK6sTsDHA8fxvZ7K8RCXUtNtupIK5thKmpiqA3OGi2aWJBPconzCH5dDfHD LPpFcDtezyhd3itWezNVWblmxMH8Oe8ll4+3euWE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ulf Hansson , Xiyu Yang , Xin Xiong , Xin Tan , Tony Lindgren , Yang Li , linux-mmc@vger.kernel.org, whitehat002 Subject: [PATCH 5.10 1/3] moxart: fix potential use-after-free on remove path Date: Wed, 9 Feb 2022 20:14:19 +0100 Message-Id: <20220209191248.941605067@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220209191248.892853405@linuxfoundation.org> References: <20220209191248.892853405@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Greg Kroah-Hartman commit bd2db32e7c3e35bd4d9b8bbff689434a50893546 upstream. It was reported that the mmc host structure could be accessed after it was freed in moxart_remove(), so fix this by saving the base register of the device and using it instead of the pointer dereference. Cc: Ulf Hansson Cc: Xiyu Yang Cc: Xin Xiong Cc: Xin Tan Cc: Tony Lindgren Cc: Yang Li Cc: linux-mmc@vger.kernel.org Cc: stable Reported-by: whitehat002 Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220127071638.4057899-1-gregkh@linuxfounda= tion.org Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Linux Kernel Functional Testing Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee --- drivers/mmc/host/moxart-mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mmc/host/moxart-mmc.c +++ b/drivers/mmc/host/moxart-mmc.c @@ -708,12 +708,12 @@ static int moxart_remove(struct platform if (!IS_ERR_OR_NULL(host->dma_chan_rx)) dma_release_channel(host->dma_chan_rx); mmc_remove_host(mmc); - mmc_free_host(mmc); =20 writel(0, host->base + REG_INTERRUPT_MASK); writel(0, host->base + REG_POWER_CONTROL); writel(readl(host->base + REG_CLOCK_CONTROL) | CLK_OFF, host->base + REG_CLOCK_CONTROL); + mmc_free_host(mmc); =20 return 0; } From nobody Sun Jun 28 09:36:36 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C814C433EF for ; Wed, 9 Feb 2022 19:18:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232988AbiBITR7 (ORCPT ); Wed, 9 Feb 2022 14:17:59 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:51470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233481AbiBITRs (ORCPT ); Wed, 9 Feb 2022 14:17:48 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5429C1DF8FA; Wed, 9 Feb 2022 11:17:41 -0800 (PST) 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 A0D476197E; Wed, 9 Feb 2022 19:15:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85FCBC340E7; Wed, 9 Feb 2022 19:15:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644434127; bh=hZXirXigZI9GoouC6CuizAWFEKIWwDBONOJmuuybl44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zD7HvA67XcD6Pv/zPupBR46gMPD6dD8oDgOcrPypFNeO2HV0q0VWlumjboeihKeR0 6X70NCgLkWMoq4ZtsgIgVxFRz0s1hzQxBPO4DFkJKoTUqnHFzAwbJxqsU3LSAJFItc bRjUoKxtpvi7/CGplVFYh6r6meB/eLqW2f0BxdHU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Janis Schoetterl-Glausch , Christian Borntraeger Subject: [PATCH 5.10 2/3] KVM: s390: Return error on SIDA memop on normal guest Date: Wed, 9 Feb 2022 20:14:20 +0100 Message-Id: <20220209191248.973709059@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220209191248.892853405@linuxfoundation.org> References: <20220209191248.892853405@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Janis Schoetterl-Glausch commit 2c212e1baedcd782b2535a3f86bc491977677c0e upstream. Refuse SIDA memops on guests which are not protected. For normal guests, the secure instruction data address designation, which determines the location we access, is not under control of KVM. Fixes: 19e122776886 (KVM: S390: protvirt: Introduce instruction data area b= ounce buffer) Signed-off-by: Janis Schoetterl-Glausch Cc: stable@vger.kernel.org Signed-off-by: Christian Borntraeger Signed-off-by: Greg Kroah-Hartman Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Linux Kernel Functional Testing Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee --- arch/s390/kvm/kvm-s390.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -4654,6 +4654,8 @@ static long kvm_s390_guest_sida_op(struc return -EINVAL; if (mop->size + mop->sida_offset > sida_size(vcpu->arch.sie_block)) return -E2BIG; + if (!kvm_s390_pv_cpu_is_protected(vcpu)) + return -EINVAL; =20 switch (mop->op) { case KVM_S390_MEMOP_SIDA_READ: From nobody Sun Jun 28 09:36:36 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF670C433FE for ; Wed, 9 Feb 2022 19:17:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232574AbiBITQ4 (ORCPT ); Wed, 9 Feb 2022 14:16:56 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:47788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiBITQx (ORCPT ); Wed, 9 Feb 2022 14:16:53 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D9FCC1DF839; Wed, 9 Feb 2022 11:16:49 -0800 (PST) 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 754F661968; Wed, 9 Feb 2022 19:15:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5AA07C340E7; Wed, 9 Feb 2022 19:15:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644434129; bh=cxAjMI/wZemz9Un7wPgNEpqPz41777mFB2zheqRyAKg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AO93oF5ZK2rhqaFJJwmNwXSq6YAzQdTPQczdtEk6SkaGhbBdQhGl8xVEhrPHfNW3k UNvZ2M1S2QWzgA5CFMGb5TnhDo9Im4LVdQzVdaZC3+S+dBHaqhTm4ykbQszS5iKNIB fJQCh4QEHRy9b65EHuWag8Bv8+214REmpNCaN4To= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Beulich , Herbert Xu Subject: [PATCH 5.10 3/3] crypto: api - Move cryptomgr soft dependency into algapi Date: Wed, 9 Feb 2022 20:14:21 +0100 Message-Id: <20220209191249.005811880@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220209191248.892853405@linuxfoundation.org> References: <20220209191248.892853405@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Herbert Xu commit c6ce9c5831cae515d375a01b97ae1778689acf19 upstream. The soft dependency on cryptomgr is only needed in algapi because if algapi isn't present then no algorithms can be loaded. This also fixes the case where api is built-in but algapi is built as a module as the soft dependency would otherwise get lost. Fixes: 8ab23d547f65 ("crypto: api - Add softdep on cryptomgr") Reported-by: Jan Beulich Signed-off-by: Herbert Xu Tested-by: Jan Beulich Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman Tested-by: Florian Fainelli Tested-by: Guenter Roeck Tested-by: Hulk Robot Tested-by: Linux Kernel Functional Testing Tested-by: Pavel Machek (CIP) Tested-by: Shuah Khan Tested-by: Slade Watkins Tested-by: Sudip Mukherjee --- crypto/algapi.c | 1 + crypto/api.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -1295,3 +1295,4 @@ module_exit(crypto_algapi_exit); =20 MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Cryptographic algorithms API"); +MODULE_SOFTDEP("pre: cryptomgr"); --- a/crypto/api.c +++ b/crypto/api.c @@ -603,4 +603,3 @@ EXPORT_SYMBOL_GPL(crypto_req_done); =20 MODULE_DESCRIPTION("Cryptographic core API"); MODULE_LICENSE("GPL"); -MODULE_SOFTDEP("pre: cryptomgr");