From nobody Fri Dec 19 21:45:40 2025 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 7165915667D for ; Sat, 8 Nov 2025 22:20:29 +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=1762640430; cv=none; b=GtSpHyMDj2uaG4l42sGZJoaEqTIoUNxJSbWkgPT3vB9pnzNyV3QzUfmwvc82xPvjlz/28dkAzLHFXDGiUTq3bPevcE1W6If6hLv0f6Bx7qzeiZud96uwfZQ+7dWT8mXiYek0RICKB10eoCD+xqffISm5r5cM0F0KENChQboA0p0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762640430; c=relaxed/simple; bh=D2bxUCipdqgy7ofKUDd0lFuuVmbC9ePnY5k6K23h/+w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dnLoWx7qY6eAaHRstoIKz5lerdjujfYbD+aAtN/cYooaoK3HbOogOlAlTKKBYU1FjYqdMXAwf46EGEMPKyMqh+is601zjy5Fw3uOCaSK4EiASaM4GQ4UhG8zqBEsYSH4r4oq5e9gJ27V8pAI21QMzVRB7yJHvWSt1oT144e81lk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bjC/sQ5N; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bjC/sQ5N" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FEA9C16AAE; Sat, 8 Nov 2025 22:20:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762640428; bh=D2bxUCipdqgy7ofKUDd0lFuuVmbC9ePnY5k6K23h/+w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bjC/sQ5NuPgCSuQWV9UNlNlM7oSf8INiIMXyM5IyWARrTDxQhQparEQEzmO008a+9 +ksw2FOBK9HDXnno1WGQYC8tlQPmW2pcs8t3ZlHihy7s7D8hE9wnkAWpa0CP3TFuC0 o6kQuLG2BKyCbbzkblrvbNEExVT4jKm5V4PrrA5umEhAiRwY87Xixt+TEwbKzN64QO xaD9nKTAmf+mqWpw6y0j38FMacqQMZSvMkQSjJF+V5zvJosAhTZ2dl/wfgOkSKBbUb bso9E9v+s0CYMaMh+8FWOz0rrpllhIitDv8Sf0gJ1WVbQwxXDUtK7xX7Y+q/F7k6Gf GPHy5UZg4tQDw== Date: Sat, 8 Nov 2025 23:20:24 +0100 From: Alejandro Colomar To: linux-kernel@vger.kernel.org Cc: Alejandro Colomar , Kees Cook , Christopher Bazley , Rasmus Villemoes , Marco Elver , Michal Hocko , Linus Torvalds , Al Viro , Alexander Potapenko , Dmitry Vyukov , Jann Horn , Andrew Morton Subject: [PATCH v2 1/4] array_size.h: Add ARRAY_END() Message-ID: <35255c1ceb54518779a45351dcd79a3c1910818a.1762637046.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ARRAY_END() returns a pointer one past the end of the last element in the array argument. This pointer is useful for iterating over the elements of an array: for (T *p =3D a, p < ENDOF(a); p++) ... Cc: Kees Cook Cc: Christopher Bazley Cc: Rasmus Villemoes Cc: Marco Elver Cc: Michal Hocko Cc: Linus Torvalds Cc: Al Viro Signed-off-by: Alejandro Colomar Message-ID: <37b1088dbd01a21d2f9d460aa510726119b3bcb0.1752193588.git.alx@ke= rnel.org> --- include/linux/array_size.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/array_size.h b/include/linux/array_size.h index 06d7d83196ca..62382973078e 100644 --- a/include/linux/array_size.h +++ b/include/linux/array_size.h @@ -10,4 +10,10 @@ */ #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(= arr)) =20 +/** + * ARRAY_END - get a pointer to one past the last element in array @a + * @a: array + */ +#define ARRAY_END(a) (a + ARRAY_SIZE(a)) + #endif /* _LINUX_ARRAY_SIZE_H */ --=20 2.51.0 From nobody Fri Dec 19 21:45:40 2025 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 42E5C15667D for ; Sat, 8 Nov 2025 22:20:33 +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=1762640434; cv=none; b=HWBF9OURl43XPAo0/5K454sayHCn2Govm8nBL5jBjWWC5lArNAmQnoc80tpUSv6BuJZtZD6tlXrU6nYtSbnHC/2Cpn5MUgLpe8i4/vsYaQHkqCs6RWg1SZefcNISeBpL/HZmCrpkcq3/8nI+RntXlcf5WE0Ir3POZOk5y40UgDY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762640434; c=relaxed/simple; bh=Rsfmd7zbC+kSZ3iat7Z+yufKodHJKLHaalHhwgTU+L8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rGuw5rtA2O8RAGeGdF0VGg/UbAwz+CwFSTAU11UVR7SujlGCshWPqYZKVca/HDpZ7+dSIc8eBUzp5j3MSz4hmFnClqiKyrLEV/fMlMQ/daEF1bZNArj1sYlyY2mlcFFaB5arK5OlLGCGfKr8e7JqLaDRfc36b+pDradp3DzbmsU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=u6Fz15xu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="u6Fz15xu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0655EC16AAE; Sat, 8 Nov 2025 22:20:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762640433; bh=Rsfmd7zbC+kSZ3iat7Z+yufKodHJKLHaalHhwgTU+L8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=u6Fz15xuhvHwUBywd+OmnWfPRmW7Ft2BIkpFqHoKheumyJQKEZsFpCwzguxBXXb/p QCZ2C8f9B1maillLjyZtjsG0hIpKw7ZdD0FQtKeAoziuSUY65LKmocOvBTmejF2iUM eFpIVm0r1QFbUh5BKzh+YH17jVWC27gojFla578snqw4asvAoir63R/url7QMew3iP q/wYUe7yGYgFq9MUTqrA/uRLiCY1hhDf4FvretMv36w/PkyqKf2U9suWFO3f12gW/g vH5ZhoZUM+hLD61zXwwcOKFseyO03fEYGfi9LDQEHO2kBWn9d8ay2007wqXjD7pp7+ onKb0jXQLkQSA== Date: Sat, 8 Nov 2025 23:20:29 +0100 From: Alejandro Colomar To: linux-kernel@vger.kernel.org Cc: Alejandro Colomar , Kees Cook , Christopher Bazley , Rasmus Villemoes , Marco Elver , Michal Hocko , Linus Torvalds , Al Viro , Alexander Potapenko , Dmitry Vyukov , Jann Horn , Andrew Morton Subject: [PATCH v2 2/4] mm: Fix benign off-by-one bugs Message-ID: X-Mailer: git-send-email 2.51.0 References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" We were wasting a byte due to an off-by-one bug. s[c]nprintf() doesn't write more than $2 bytes including the null byte, so trying to pass 'size-1' there is wasting one byte. Acked-by: Marco Elver Cc: Kees Cook Cc: Christopher Bazley Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Alexander Potapenko Cc: Jann Horn Cc: Andrew Morton Cc: Linus Torvalds Cc: Rasmus Villemoes Cc: Marco Elver Cc: Michal Hocko Cc: Al Viro Signed-off-by: Alejandro Colomar Message-ID: <515445ae064d4b8599899bf0d8b480dadd2ff843.1752182685.git.alx@ke= rnel.org> --- mm/kfence/kfence_test.c | 4 ++-- mm/kmsan/kmsan_test.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/kfence/kfence_test.c b/mm/kfence/kfence_test.c index 00034e37bc9f..5725a367246d 100644 --- a/mm/kfence/kfence_test.c +++ b/mm/kfence/kfence_test.c @@ -110,7 +110,7 @@ static bool report_matches(const struct expect_report *= r) =20 /* Title */ cur =3D expect[0]; - end =3D &expect[0][sizeof(expect[0]) - 1]; + end =3D ARRAY_END(expect[0]); switch (r->type) { case KFENCE_ERROR_OOB: cur +=3D scnprintf(cur, end - cur, "BUG: KFENCE: out-of-bounds %s", @@ -140,7 +140,7 @@ static bool report_matches(const struct expect_report *= r) =20 /* Access information */ cur =3D expect[1]; - end =3D &expect[1][sizeof(expect[1]) - 1]; + end =3D ARRAY_END(expect[1]); =20 switch (r->type) { case KFENCE_ERROR_OOB: diff --git a/mm/kmsan/kmsan_test.c b/mm/kmsan/kmsan_test.c index 902ec48b1e3e..b5ad5dfb2c00 100644 --- a/mm/kmsan/kmsan_test.c +++ b/mm/kmsan/kmsan_test.c @@ -105,7 +105,7 @@ static bool report_matches(const struct expect_report *= r) =20 /* Title */ cur =3D expected_header; - end =3D &expected_header[sizeof(expected_header) - 1]; + end =3D ARRAY_END(expected_header); =20 cur +=3D scnprintf(cur, end - cur, "BUG: KMSAN: %s", r->error_type); =20 --=20 2.51.0 From nobody Fri Dec 19 21:45:40 2025 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 D5F7B287508 for ; Sat, 8 Nov 2025 22:20:38 +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=1762640438; cv=none; b=NuGn10cFfePzjVr7X1+CBeldwlNQ9ejKNcD6ZAjo2f87xVLQD4C3DXV2LvgFolXaY7UmH9XNw2x9JCBq7TYRRFncxV9XEsDWkyJtJ3+DEHC6yOtn8AXY4IyOnHtU3sYRT7tyOOXBpUyZP2jmrxRVbdbKNKWKX/j3xoQ2cwdPu4g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762640438; c=relaxed/simple; bh=59w6p5OIO0ukVj/H6iWXGVoWsjSUgZ8nYZ9Xx2PeP8w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VI7dgzeuPvl7hLjwvbq/Mo2y3BGDmUXEjRjtEwXj4bB/WX5jqoEgNopJSw2CVH8iKuZ6TknK15aoIj1RrZnQ++uy1qlpM940AqFE6O1QI0LHDejce9W2G6fEIroPoBJjeNKLkeZl/XG095Rgzl//NzzCt42r+qNWmATFx1FImrU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Mzyt1Yoy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Mzyt1Yoy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4A42C113D0; Sat, 8 Nov 2025 22:20:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762640438; bh=59w6p5OIO0ukVj/H6iWXGVoWsjSUgZ8nYZ9Xx2PeP8w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Mzyt1Yoyty3gGLNjAe4JO4ekMYedwKfiNvmW76diuxT95rn8ERHxwndRMz6jMw+La h4K7MiqVPo8z9t/w94rg+JkPiyV/EbfyHYGNVFVEi/7cerLZFPkG7/jeE96FZt38uc jsagjnGF23DhNV3tZlVtcs+7LSDElYiwhj8Lua5f24oZVf/e/EhBq+r/MqrLpUuJ3b zGEioEununZPoNK5i3Hgpq6EZGy90NxapNRLv3D24NzaH86UqWt7HQM5yu4BpyhqZX xWEFvtoye8FKd25jgDwgKTxmNWtOD+v+iRYLQ006kdDkWzrgVTiSy0ZKDsQ2qXWmoY 1YPHKY/5hXgNA== Date: Sat, 8 Nov 2025 23:20:34 +0100 From: Alejandro Colomar To: linux-kernel@vger.kernel.org Cc: Alejandro Colomar , Kees Cook , Christopher Bazley , Rasmus Villemoes , Marco Elver , Michal Hocko , Linus Torvalds , Al Viro , Alexander Potapenko , Dmitry Vyukov , Jann Horn , Andrew Morton Subject: [PATCH v2 3/4] kernel: Fix off-by-one benign bugs Message-ID: <781cce547eb29aa82571d0aaa7423fb2a1f59a8c.1762637046.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" We were wasting a byte due to an off-by-one bug. s[c]nprintf() doesn't write more than $2 bytes including the null byte, so trying to pass 'size-1' there is wasting one byte. This is essentially the same as the previous commit, in a different file. Cc: Marco Elver Cc: Kees Cook Cc: Christopher Bazley Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Alexander Potapenko Cc: Jann Horn Cc: Andrew Morton Cc: Linus Torvalds Cc: Rasmus Villemoes Cc: Marco Elver Cc: Michal Hocko Cc: Al Viro Signed-off-by: Alejandro Colomar --- kernel/kcsan/kcsan_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/kcsan/kcsan_test.c b/kernel/kcsan/kcsan_test.c index 219d22857c98..8ef8167be745 100644 --- a/kernel/kcsan/kcsan_test.c +++ b/kernel/kcsan/kcsan_test.c @@ -176,7 +176,7 @@ static bool __report_matches(const struct expect_report= *r) =20 /* Title */ cur =3D expect[0]; - end =3D &expect[0][sizeof(expect[0]) - 1]; + end =3D ARRAY_END(expect[0]); cur +=3D scnprintf(cur, end - cur, "BUG: KCSAN: %s in ", is_assert ? "assert: race" : "data-race"); if (r->access[1].fn) { @@ -200,7 +200,7 @@ static bool __report_matches(const struct expect_report= *r) =20 /* Access 1 */ cur =3D expect[1]; - end =3D &expect[1][sizeof(expect[1]) - 1]; + end =3D ARRAY_END(expect[1]); if (!r->access[1].fn) cur +=3D scnprintf(cur, end - cur, "race at unknown origin, with "); =20 --=20 2.51.0 From nobody Fri Dec 19 21:45:40 2025 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 8D34D28B407 for ; Sat, 8 Nov 2025 22:20:43 +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=1762640443; cv=none; b=t0M6yWuBx7xf0g3fOxrgxNjiW1SnyrBOfhf/QKoJNuDxn5WiMwr9JRbL8sZ8HqnWdEDP8rv+8iP0tHU8hnA0cQYCFUeY3p7DMegjXJLDxClKRtcLkEZXGDq2nUD5VNN2ezx2q3Ljf/1ED21KPxA2JtxD0pUl58XFBuVCEMbrhA8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762640443; c=relaxed/simple; bh=kaO5/IVrebOzmYLwKVSEsBGlfzzeuU+iOQME8bN/Vgw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Bbb8mvCwqYv2kQUUwWxHlNalKENuL6NT2wks/gNflk2/bvqhb15k+zYmhzgiNfm3IYEYL8dRveVVStIyaTeqqS5coZSQRM9EUNseWW5InDdE4SJXTbvh27GGqmlsYVOy9+bM7il4KUXL7nsUVODP35Uz/CiM4ZYz9vx+zPsw0iA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AbObin2I; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AbObin2I" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3E34C113D0; Sat, 8 Nov 2025 22:20:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762640443; bh=kaO5/IVrebOzmYLwKVSEsBGlfzzeuU+iOQME8bN/Vgw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AbObin2I4+M3iJGSBJQ8EoGOSMIOY9Ogudxz00X2fTasZX5I3Uz9nxV760dS5ln1q GvbGaMNKUQgCwtiLDiSdjzH1sBMopfSy2a5s9tM/bmoIT24S6ap3F77DNsiXYjlYLz vvA9KphcWJrlVjOXuCcCp04v153Zpuhj87S+0wnC7IHmPupx6GDXcMFZKXB2ej/1OS bUDzKFiU27bSaU0zkhzxqlbESGN9BTx4rzdqvn1YvWSOnT3cLz3h8tM6REJcdSmQMm 0Hjw66sfWqrsfyNneC+ne85kPZ2mJpUSHXzg+I8HZCBz/6xpobs/GeS2yfNfugDXva u33ms1X96ElMw== Date: Sat, 8 Nov 2025 23:20:38 +0100 From: Alejandro Colomar To: linux-kernel@vger.kernel.org Cc: Alejandro Colomar , Kees Cook , Christopher Bazley , Rasmus Villemoes , Marco Elver , Michal Hocko , Linus Torvalds , Al Viro , Alexander Potapenko , Dmitry Vyukov , Jann Horn , Andrew Morton Subject: [PATCH v2 4/4] mm: Use ARRAY_END() instead of open-coding it Message-ID: <094878542457310b784a60bbd2d444d129c61b66.1762637046.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Cc: Kees Cook Cc: Linus Torvalds Signed-off-by: Alejandro Colomar --- mm/kmemleak.c | 2 +- mm/memcontrol-v1.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 1ac56ceb29b6..fe33f2edfe07 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -510,7 +510,7 @@ static void mem_pool_free(struct kmemleak_object *objec= t) { unsigned long flags; =20 - if (object < mem_pool || object >=3D mem_pool + ARRAY_SIZE(mem_pool)) { + if (object < mem_pool || object >=3D ARRAY_END(mem_pool)) { kmem_cache_free(object_cache, object); return; } diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index 6eed14bff742..b2f37bd939fa 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -1794,7 +1794,7 @@ static int memcg_numa_stat_show(struct seq_file *m, v= oid *v) =20 mem_cgroup_flush_stats(memcg); =20 - for (stat =3D stats; stat < stats + ARRAY_SIZE(stats); stat++) { + for (stat =3D stats; stat < ARRAY_END(stats); stat++) { seq_printf(m, "%s=3D%lu", stat->name, mem_cgroup_nr_lru_pages(memcg, stat->lru_mask, false)); @@ -1805,7 +1805,7 @@ static int memcg_numa_stat_show(struct seq_file *m, v= oid *v) seq_putc(m, '\n'); } =20 - for (stat =3D stats; stat < stats + ARRAY_SIZE(stats); stat++) { + for (stat =3D stats; stat < ARRAY_END(stats); stat++) { =20 seq_printf(m, "hierarchical_%s=3D%lu", stat->name, mem_cgroup_nr_lru_pages(memcg, stat->lru_mask, --=20 2.51.0