From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3192D2EE262; Tue, 31 Mar 2026 16:32:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774974729; cv=none; b=ZyDdEgLxX2luZU1SEbFOQNRM6T1iCsG9ADgnowyCCDoH+njwTrs638rhpiQ+JsBPnyKAJacSBWqlij/Ah5nGd2oDrDkvU7YOwGGRUsNMjOeWPPomYVDADzQzAaf/8PwhWEDmdIIn9bnqCYFdoiesqBmcMNw3j0STH1e127w1kGs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774974729; c=relaxed/simple; bh=R50/Gjrw/lqbdunBmhpSWxqs5D1qpmDf8woIqJcRIow=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d7w6wRK0Siw1rh4D0tyxwwfxsmAvdr0PAoNYS8uajYq9HOkVTz/y81qmYohoWY55NXYBtu2qvPctlFpzxyoM1SAJU5I7e5yV4hJpLlG2d9VT3v7v4Gct3C97SK6N+8AE1qPZ0RVzgpsqGaKkq3CvHOCxlYvz/hNt4Fniwh1S0UM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Y456g68i; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Y456g68i" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC066C19423; Tue, 31 Mar 2026 16:32:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774974729; bh=R50/Gjrw/lqbdunBmhpSWxqs5D1qpmDf8woIqJcRIow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y456g68i93Quq637d+QlIka6sT70nRm6+x/1+v3sEMYQUJarT0eXN0b2hbog69zQt CM7BsynJ/IKhv25Jow7re0WH8WoCNOULcocZKBrbSYAp/Da33t2+aBqLx+JcJbDarT iyFwukkyifnYTJf5Bwih87gw4NYOolt6sU73TUMw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Heiko Carstens , Claudio Imbrenda , Christian Borntraeger , Janosch Frank , Sasha Levin Subject: [PATCH 6.19 007/342] s390/mm: Add missing secure storage access fixups for donated memory Date: Tue, 31 Mar 2026 18:17:20 +0200 Message-ID: <20260331161759.183390510@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260331161758.909578033@linuxfoundation.org> References: <20260331161758.909578033@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Janosch Frank [ Upstream commit b00be77302d7ec4ad0367bb236494fce7172b730 ] There are special cases where secure storage access exceptions happen in a kernel context for pages that don't have the PG_arch_1 bit set. That bit is set for non-exported guest secure storage (memory) but is absent on storage donated to the Ultravisor since the kernel isn't allowed to export donated pages. Prior to this patch we would try to export the page by calling arch_make_folio_accessible() which would instantly return since the arch bit is absent signifying that the page was already exported and no further action is necessary. This leads to secure storage access exception loops which can never be resolved. With this patch we unconditionally try to export and if that fails we fixup. Fixes: 084ea4d611a3 ("s390/mm: add (non)secure page access exceptions handlers") Reported-by: Heiko Carstens Suggested-by: Heiko Carstens Reviewed-by: Claudio Imbrenda Tested-by: Christian Borntraeger Signed-off-by: Janosch Frank Signed-off-by: Christian Borntraeger Signed-off-by: Sasha Levin --- arch/s390/mm/fault.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index e2e13778c36a9..b977150443550 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -441,10 +441,17 @@ void do_secure_storage_access(struct pt_regs *regs) folio = phys_to_folio(addr); if (unlikely(!folio_try_get(folio))) return; - rc = arch_make_folio_accessible(folio); + rc = uv_convert_from_secure(folio_to_phys(folio)); + if (!rc) + clear_bit(PG_arch_1, &folio->flags.f); folio_put(folio); + /* + * There are some valid fixup types for kernel + * accesses to donated secure memory. zeropad is one + * of them. + */ if (rc) - BUG(); + return handle_fault_error_nolock(regs, 0); } else { if (faulthandler_disabled()) return handle_fault_error_nolock(regs, 0); -- 2.51.0