public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Suren Baghdasaryan <surenb@google.com>
To: vbabka@suse.cz
Cc: akpm@linux-foundation.org, cl@gentwo.org, rientjes@google.com,
	 roman.gushchin@linux.dev, harry.yoo@oracle.com,
	shakeel.butt@linux.dev,  alexei.starovoitov@gmail.com,
	usamaarif642@gmail.com, 00107082@163.com,
	 souravpanda@google.com, kent.overstreet@linux.dev,
	surenb@google.com,  linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH 2/2] slab: mark slab->obj_exts allocation failures unconditionally
Date: Mon, 15 Sep 2025 13:09:18 -0700	[thread overview]
Message-ID: <20250915200918.3855580-3-surenb@google.com> (raw)
In-Reply-To: <20250915200918.3855580-1-surenb@google.com>

alloc_slab_obj_exts() should mark failed obj_exts vector allocations
independent on whether the vector is being allocated for a new or an
existing slab. Current implementation skips doing this for existing
slabs. Fix this by marking failed allocations unconditionally.

Fixes: 09c46563ff6d ("codetag: debug: introduce OBJEXTS_ALLOC_FAIL to mark failed slab_ext allocations")
Reported-by: Shakeel Butt <shakeel.butt@linux.dev>
Closes: https://lore.kernel.org/all/avhakjldsgczmq356gkwmvfilyvf7o6temvcmtt5lqd4fhp5rk@47gp2ropyixg/
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Cc: stable@vger.kernel.org # v6.10+
---
 mm/slub.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index af343ca570b5..cab4e7822393 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2029,8 +2029,7 @@ int alloc_slab_obj_exts(struct slab *slab, struct kmem_cache *s,
 			   slab_nid(slab));
 	if (!vec) {
 		/* Mark vectors which failed to allocate */
-		if (new_slab)
-			mark_failed_objexts_alloc(slab);
+		mark_failed_objexts_alloc(slab);
 
 		return -ENOMEM;
 	}
-- 
2.51.0.384.g4c02a37b29-goog



  parent reply	other threads:[~2025-09-15 20:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15 20:09 [PATCH 0/2] fixes for slab->obj_exts allocation failure handling Suren Baghdasaryan
2025-09-15 20:09 ` [PATCH 1/2] slab: prevent warnings when slab obj_exts vector allocation fails Suren Baghdasaryan
2025-09-15 20:14   ` Shakeel Butt
2025-09-15 20:09 ` Suren Baghdasaryan [this message]
2025-09-15 20:15   ` [PATCH 2/2] slab: mark slab->obj_exts allocation failures unconditionally Shakeel Butt
2025-09-16 12:35 ` [PATCH 0/2] fixes for slab->obj_exts allocation failure handling Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250915200918.3855580-3-surenb@google.com \
    --to=surenb@google.com \
    --cc=00107082@163.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=cl@gentwo.org \
    --cc=harry.yoo@oracle.com \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=souravpanda@google.com \
    --cc=stable@vger.kernel.org \
    --cc=usamaarif642@gmail.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox