From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796294033; b=Ot1LI2YTks2EcEJQBf3Ke1D/8nPWD0fMM7Bng84cSC1pNUz29UjkI/2YZJdjAID6Xz8A 5CrRWw6HZRBYFURJ1jqKKrsQkVLpWDuRMEko5rNmcRSJ7gRLMXPPl35ZL/0Zxg+hPRx+S ajSOCVOxnM0VIlzzvYlPv3BGhe3QxcG6gSeE3I1GT1h4kdtSk7aLudn0GowScjPS3E8Wc 7Da1rSMLUEEaZP02UW3YuiPnC5C/IAFmidlDZ4wPGTXKcLD+fqr5x7xJAG9dja4W5mOl/ Z7CkAAxos+ApsnKkmVJl3J/RskGlzPOqBauOwkCvps3JczVBmQUn62+STK3OEU7PWWw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796294033; h=DMARC-Filter:Received:DKIM-Signature:Received:Received:Received: Received:Received:Received:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-TM-AS-GCONF:X-Proofpoint-GUID: X-Proofpoint-Spam-Info:X-Proofpoint-Spam-Details-Enc: X-Authority-Analysis:X-Proofpoint-ORIG-GUID: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=ike7r5BNIz7xqYW9tnmGUPwdr0jJDUhQgkva/eFr2Ak=; b=stquPzMUMeIUSUkX9iBmtzfemyCS929z5nQ4jDAp64Aj/FXuQUEFlDbN0bPwDDeOv7l9 Zs4SnY/UEhMp5rUmdUhf1m+yNnbo6g34dwvu6AMjc7HJGCQdvoSCEUeLeRKeQpwe0wSwL wYx/1MKCJjRO22u2DhMEyS8Kfh59669m4/NHbQ3pLvZ0jyrkIz36y8XVv7JF+YKtof9zU 2/aQwmtTPXQqHoHcc4DlWZ1r8JjrleNUqsMgrEsGW2/UPn7Cexx4sJKjVik01OwdRKC5J nuPB/IKnyqPIy7w1fIx2Vvi5ZG78fbRqV30/Vl9Wt0M7CJFkvwjUrSDcPATmzMVa8Ag== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=ricnLE9j; arc=none smtp.remote-ip=148.163.156.1 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C218606A322; Thu, 3 Dec 2026 10:33:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4C218606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=ricnLE9j Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B374TPV2738638; Thu, 3 Dec 2026 10:33:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=ike7r5BNIz7xqYW9t nmGUPwdr0jJDUhQgkva/eFr2Ak=; b=ricnLE9jRmwxmAr+MR8tCTNicnVdSBtpv oJsIean33bG7LIxIkGoc388hw5hGOXUEZrVu7q5GRAUoehSj1Y5zqnONiw7dSmyK czSYhpui6baJPjSdiVkPWzFyc0mXNvq0xOHoH7VXXVuFiYZIjlMRIfDkTL+fFpAe ODjAwl2z1oAa2LUtbZJI0+XFuhNeE3Usukc3oPynhrxGaCb/yXmeJDGIxpBggsLW eud1al3z/Pf+gJHig1hrhp5QOkwoeuAliFjBo8VeMAqacZKdb+gPfpKf+MW/Lx70 +HjCRraJ2um8FYLoyaBHihnm4YjtvQyASgjb5P9n36O7QcEPz67jg== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4j7pp66e7n-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 03 Dec 2026 10:33:50 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 6B3AJKik289311; Thu, 3 Dec 2026 10:33:50 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4jb5a1gc08-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Dec 2026 10:33:50 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6B3AXkbc41681348 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 Dec 2026 10:33:46 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B1D82004B; Thu, 3 Dec 2026 10:33:46 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 41EE82004F; Thu, 3 Dec 2026 10:33:46 +0000 (GMT) Received: from tuxmaker.lnxne.boe (unknown [9.87.85.9]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 3 Dec 2026 10:33:46 +0000 (GMT) From: Heiko Carstens To: Alexander Gordeev , Sven Schnelle , Vasily Gorbik , Christian Borntraeger , Mike Rapoport , Gerald Schaefer Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 01/17] s390/boot: Initialize asce_limit for init_mm properly Date: Thu, 3 Dec 2026 11:33:29 +0100 Message-ID: <20261203103345.1206548-2-hca@linux.ibm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261203103345.1206548-1-hca@linux.ibm.com> References: <20261203103345.1206548-1-hca@linux.ibm.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: jVqPtqPGav--QoZu8XKOU_bUsBUU6aWT X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAzMDA0MCBTYWx0ZWRfX6vyU/BPzcUZj z5m7QfZ1yXodAG0Mgm3P9VRWoCX5FKixrYal+im3JbEYFz/M9jDTduQOLHR4JuqzzrteddOwg+h cgyMp9Rol/9YsYEGhmIJT//I57xHzGo= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAzMDA0MCBTYWx0ZWRfX5x4KGBAXdnTH uyf6L07RQWKQ82TECRjz6EVH0xGp0HKFuTCbFOK0q1P1hvpWjuRSq1Iqg+JXs6XfBoqU81nCe2T kK5lTeA1sqP82ih24DE+xBjlZJl/BMd7QwwJl2fC91obbJ6euD0ckZZVQMxTLVAedr88tK6xI2Z XR4+2dKvGzdZg9SSHChW52+6KobGMjWZgry14ZYUx9h79nwBhLRJkMI4bW4WQAAR5E8MM1rgKEO Wc0bur9irChhEu82PUzb/qM5PpuNjn+fuxRdH1SFQNcui0PHFNezxeT25t/gzjxVTNkgobw+vC5 J89YwVO0TXHQ94KcF5UcYqqgB08Ej6GGNm8nittZeGiKX31USN7707iowLg7kLaRyA13f1Qnptg gm+ODHxiwnnhO2QcXd7ihSATbQXO+TOzbSJFkZuPBAh8ONLGtpzjE9J45t58aw0Rp6F4Gilni3u pTMXOFnOqMTf5lkRmDw== X-Authority-Analysis: v=2.4 cv=Ae8kjHXG c=1 sm=1 tr=0 ts=6b11458f cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=pUM-KoujPXoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VnNF1IyMAAAA:8 a=U_SMJKujlClj_6FCki8A:9 X-Proofpoint-ORIG-GUID: jVqPtqPGav--QoZu8XKOU_bUsBUU6aWT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-03_02,2026-12-02_07,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 spamscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612030040 asce_limit of init_mm is always zero instead of reflecting the address space size. The mm_pxd_folded() helpers used in pxd_free() require a proper asce_limit to work correctly. With asce_limit of init_mm being zero the pxd_free() functions never free page tables, since mm_pxd_folded(&init_mm) evaluates to true. As of now there are only a few corner cases where this matters, e.g. during concurrent vmalloc allocation races or KASAN shadow unmapping, leading to memory leaks. Fix this and initialize asce_limit of init_mm. Fixes: 2416cefc504b ("s390/mm: add mm_pxd_folded() checks to pxd_free()") Signed-off-by: Heiko Carstens --- arch/s390/boot/vmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390/boot/vmem.c b/arch/s390/boot/vmem.c index ff6d58a476ba..3111a96e68e9 100644 --- a/arch/s390/boot/vmem.c +++ b/arch/s390/boot/vmem.c @@ -554,5 +554,6 @@ void setup_vmem(unsigned long kernel_start, unsigned long kernel_end, unsigned l local_ctl_load(13, &get_lowcore()->kernel_asce); init_mm.context.asce = get_lowcore()->kernel_asce.val; + init_mm.context.asce_limit = asce_limit; init_mm.pgd = init_mm_pgd; } -- 2.53.0