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=1796183273; b=sNqA6yExRWkkLAxLY2DjjqItSvdIWKvUEXJkaEytfYsO40OGAoCRvTObkzH0XybYImZJ mZvUVrptN7pZ0xSAg6YNVTt2iyQ4McQycEkdjZ9ekoo/ACQ3fL+VDLb5caArg5pR6iuB4 zvL5/mqFQFKrLIPA5lDSpwccrzzK1ROGMQ6p5EYVZATOhKNIQEumZFZGFr8cIVhD/OC2f f/6HhQI9sphKy0DCWUDeqy7n6meIcvUjK+oVoj8zonXaokLCCTb4Ek+BJ678FK1A7ANSg rdoMmkJ6DGWg02PxHrqwgX+0rtRO197RJZ1pHbXsIJnPORLRW/tRsqsg9ql3FOLb2Ig== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796183273; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=plvjXRjX+8Ss3KpOipmyFEraO9o61KmouajlGGQ9n3E=; b=5ZQwLI1bVefDKUefaDujVoWktEnybw6FNefCxO5dCm5MaPGzeW21m4vaKNV1uzhEo9pL rLkkgpqZKh6MCp/UV/SX9ILYG9oAjZQ5rKhHJ3cJYZCDi+Zh9nHazjb8UGMfYBBBIbDNx Jh6V8NPr0Dx68TdQw/D8UH7DCwnY8DnYRxAfmjpb/1MgcYvPKW1cj9lfLD/ezP6ODWdK8 /gQZzRxd/g1r+UtKEae0qK0NSGNskO1Ymay7KlXDuMl03BXDUKm8tSiX6aNv/a7qTNUYK kHiFqG8kIIe5aCeMfpp5PRxbP2Tw6zps6RYjXjwWbzrAFmpXAJ7/s4rAToFfOEf4eow== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b="um07/Fzq"; 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 8A441606A329; Wed, 2 Dec 2026 03:47:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=um07/Fzq Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E9621F00893; Wed, 2 Dec 2026 03:47:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796183273; bh=plvjXRjX+8Ss3KpOipmyFEraO9o61KmouajlGGQ9n3E=; h=Date:To:From:In-Reply-To:References:Subject; b=um07/Fzq/FY8IKWzBXeYucfVoIui1gvOyIIIkwlaiP4zFctqUtL1e+gtvOQGBIn1c IEtrkH1VOuohRM0Y6NG/261gwXLD8Cz/XlhoPPxMquG2+RDGINdDxerj/LNOKlS2Ag V3AGzFQ2Zmt+ub8ewfbcznCd4TyRW46uLMPwFz58= Date: Tue, 01 Dec 2026 19:47:52 -0800 To: mm-commits@vger.kernel.org,youngjun.park@lge.com,stable@vger.kernel.org, sj@kernel.org,shikemeng@huaweicloud.com,nphamcs@gmail.com,kees@kernel.org, kasong@tencent.com,gustavo@embeddedor.com,gustavoars@kernel.org, chrisl@kernel.org,baoquan.he@linux.dev,baohua@kernel.org, android-mm@google.com,kaleshsingh@google.com,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261120061750.2973004-1-kaleshsingh@google.com> References: <20261120061750.2973004-1-kaleshsingh@google.com> Subject: [merged mm-hotfixes-stable] mm-swap-make-swap_header-badpages-a-flexible-array.patch removed from -mm tree Message-Id: <20261202034753.4E9621F00893@smtp.kernel.org> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The quilt patch titled Subject: mm: swap: make swap_header badpages a flexible array has been removed from the -mm tree. Its filename was mm-swap-make-swap_header-badpages-a-flexible-array.patch This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: Kalesh Singh Subject: mm: swap: make swap_header badpages a flexible array Date: Fri, 20 Nov 2026 06:17:49 +0000 The swap header declares its list of bad pages as a one-element array, even though the list can fill the rest of the header page. Since the kernel is built with -fstrict-flex-arrays=3, the compiler takes that size literally, so with UBSAN bounds checking, swapon() of a swap area with two or more bad pages reports an out-of-bounds access: UBSAN: array-index-out-of-bounds in mm/swapfile.c:3674:26 index 1 is out of range for type '__u32[1]' (aka 'unsigned int[1]') Kernels that trap on UBSAN reports and panic on oops, such as Android GKI kernels, crash instead. Declare the list as a flexible array. The layout of the swap header does not change. Link: https://patch.msgid.link/20261120061750.2973004-1-kaleshsingh@google.com Fixes: df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") Signed-off-by: Kalesh Singh Signed-off-by: Andrew Morton Reviewed-by: SJ Park Reviewed-by: Gustavo A. R. Silva Cc: Kees Cook Cc: Christopher Li Cc: Kairui Song Cc: Kemeng Shi Cc: Nhat Pham Cc: Baoquan He Cc: Barry Song Cc: Youngjun Park Cc: Cc: "Gustavo A. R. Silva" Cc: # 6.6.y, 6.12.y, 6.18.y include/linux/swap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/swap.h~mm-swap-make-swap_header-badpages-a-flexible-array +++ a/include/linux/swap.h @@ -129,7 +129,7 @@ union swap_header { unsigned char sws_uuid[16]; unsigned char sws_volume[16]; __u32 padding[117]; - __u32 badpages[1]; + __u32 badpages[]; } info; }; _ Patches currently in -mm which might be from kaleshsingh@google.com are selftests-mm-uffd-wp-mremap-skip-unsupported-shmem-and-hugetlb-cases.patch selftests-mm-uffd-unit-tests-filter-required-features-per-memory-type.patch