From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796295691; b=KldSRmtexbMBG+CC3zsCbOkSIkO0VnLhjPF7rcIZxxc/27jXKGdl42KT9QaY+09+K1nj dwaF0RPfX5Nf+oM8ok9vsidfUti44PChj4myPUJwp1xSkW7qnD8NT6BapN64mr+qJjz0E jLlqwntfSfl694X7xWMvvHHCd+nFR4Tx2AQXEod2KN1SNxgTJS2f9et2C84RN4yRTMyo3 9eobK00Pf8L/rIIIeK+izf7LGaetLUoSzdOQdckTAnoqrvM79lBeeEu8oiL3B0Gms04gl 9jKYP8u6+TW0qW+TcRIv6dlYz/iBg2fSihQgDgHOUOcu8mQ2yD90KmSw8YV1/RoqO0w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796295691; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=YWLDpd5pyRE7UWqlGr394U+pUJSa4zaex9v6XR961ZM=; b=akqnH7+bkgrJnCHaPOdROio+tGToG1kJ+KgySy3VUnBmYFsqBfqGG2DazGR0xeNBTnfl op6Di8eUVYH9MPqoWttx28embEremdJ/Oxa1sishHafZklSeuF1YkQUO2Aj6FaRqcosep t2vAcWr6NPC1+9eYIANjC6C5fp+d2ZcPRSzdJyq18BGy6xj5AbUccJ2cu6Sy4EiMaRaNp WF6Xr4FCMD1s18XTxDrii6w4Jf5XPwlm6mxoimPS3gu0uin+0YQQqg+4f4V6vvPMvqaga hXrWFijo9AbWiw46Lk6sUOYeztvl4HJQNyhVdXalbMr4Fg1RTuotdN6SSTEq0M3T5cg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dm0lH2p0; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BA19606A322 for ; Thu, 3 Dec 2026 11:01:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dm0lH2p0 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84B841F000C1; Thu, 3 Dec 2026 11:01:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796295690; bh=YWLDpd5pyRE7UWqlGr394U+pUJSa4zaex9v6XR961ZM=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=dm0lH2p0mM+FluoIWc84VO5oJoAGzzYzQbyEq/jWNzGXwNNbr0BYW9hPx7++05Dsm 6oDSMtbfmE4FCxpQ+GLOq7/qwLkQuMpEYLI017qDqijiFq/JL48jVNY3TPxNcyBh+c bedfDZPxJrq+a8lX7Y/lI3WJWmFVa7NPg9EvljLRVJSnG20uMVLNehJzHd1AjKDF71 FJvEdpqKa5qxsCDoTx/VleROy5fUv/eGeVSZg7g1PSaYzE9o2vs9i60Bbq8w9ZaGi1 Kt3xAlyPn7T+3Vc1MYmrO8kz7q1braWmx9plMas4x1A3EvggAK/ZvHRFmSpyA7X3qJ OVGJuh1tbOBHg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 01/17] s390/boot: Initialize asce_limit for init_mm properly Reply-To: sashiko-reviews@lists.linux.dev To: "Heiko Carstens" Cc: linux-s390@vger.kernel.org, "Vasily Gorbik" , "Alexander Gordeev" , "Christian Borntraeger" In-Reply-To: <20261203103345.1206548-2-hca@linux.ibm.com> References: <20261203103345.1206548-1-hca@linux.ibm.com> <20261203103345.1206548-2-hca@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 11:01:30 +0000 X-Mailing-List: linux-s390@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] s390/mm: crst_table_free() fails to handle PageReserved boot CRST tables -- commit 5e9062421f6de1bcabdbba28757388ac9f8205cd Author: Heiko Carstens s390/boot: Initialize asce_limit for init_mm properly This commit initializes init_mm.context.asce_limit in setup_vmem() so that mm_pxd_folded(&init_mm) reflects the kernel address space size and pxd_free= () can free init_mm page tables. > diff --git a/arch/s390/boot/vmem.c b/arch/s390/boot/vmem.c > index ff6d58a476bae..3111a96e68e9e 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); > =20 > init_mm.context.asce =3D get_lowcore()->kernel_asce.val; > + init_mm.context.asce_limit =3D asce_limit; > init_mm.pgd =3D init_mm_pgd; > } [Severity: Medium] Can setting init_mm.context.asce_limit cause crst_table_free() to pass a boot-allocated PageReserved CRST table to pagetable_free()? Previously, mm_pmd_folded(&init_mm) and mm_pud_folded(&init_mm) always returned true, so pmd_free(&init_mm, ...) and pud_free(&init_mm, ...) never called crst_table_free(). Unlike page_table_free(), crst_table_free() does not check pagetable_is_reserved(ptdesc) and calls pagetable_free() directly. Under CONFIG_KASAN with standby memory making ident_map_size unaligned to 16GB above a 16GB-aligned online end, kasan_populate_shadow() allocates a boot_crst_alloc() PMD table (non-compound, PG_reserved, order CRST_ALLOC_ORDER) with only its upper zero-shadow entries populated. When a ZONE_DEVICE or dcssblk mapping covering that upper range is removed via kasan_remove_zero_shadow() -> kasan_free_pmd() -> pmd_free(&init_mm, ..= .), all entries become pmd_none and crst_table_free() calls __free_pages(page, = 0) on that reserved page. With page checks enabled, free_page_is_bad() reports a bad page state and leaks all 4 pages; without them, page 0 is freed without updating managed_pages while the other 3 pages leak. Should crst_table_free() check pagetable_is_reserved(ptdesc) and free the table with free_reserved_pages(ptdesc_page(ptdesc), CRST_ALLOC_ORDER)? --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203103345.1206= 548-1-hca@linux.ibm.com?part=3D1