Go to file
Hao Ge 8f4c0c2fa3 slab: reset slab->obj_ext when freeing and it is OBJEXTS_ALLOC_FAIL
commit 86f54f9b6c upstream.

If obj_exts allocation failed, slab->obj_exts is set to OBJEXTS_ALLOC_FAIL,
But we do not clear it when freeing the slab. Since OBJEXTS_ALLOC_FAIL and
MEMCG_DATA_OBJEXTS currently share the same bit position, during the
release of the associated folio, a VM_BUG_ON_FOLIO() check in
folio_memcg_kmem() is triggered because the OBJEXTS_ALLOC_FAIL flag was
not cleared, causing it to be interpreted as a kmem folio (non-slab)
with MEMCG_OBJEXTS_DATA flag set, which is invalid because
MEMCG_OBJEXTS_DATA is supposed to be set only on slabs.

Another problem that predates sharing the OBJEXTS_ALLOC_FAIL and
MEMCG_DATA_OBJEXTS bits is that on configurations with
is_check_pages_enabled(), the non-cleared bit in page->memcg_data will
trigger a free_page_is_bad() failure "page still charged to cgroup"

When freeing a slab, we clear slab->obj_exts if the obj_ext array has
been successfully allocated. So let's clear it also when the allocation
has failed.

Fixes: 09c46563ff ("codetag: debug: introduce OBJEXTS_ALLOC_FAIL to mark failed slab_ext allocations")
Fixes: 7612833192 ("slab: Reuse first bit for OBJEXTS_ALLOC_FAIL")
Link: https://lore.kernel.org/all/20251015141642.700170-1-hao.ge@linux.dev/
Cc: <stable@vger.kernel.org>
Signed-off-by: Hao Ge <gehao@kylinos.cn>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-23 16:24:21 +02:00
arch x86/CPU/AMD: Prevent reset reasons from being retained across reboot 2025-10-23 16:24:21 +02:00
block blk-crypto: fix missing blktrace bio split events 2025-10-19 16:37:23 +02:00
certs
crypto crypto: essiv - Check ssize for decryption and in-place encryption 2025-10-19 16:37:14 +02:00
Documentation docs: kdoc: handle the obsolescensce of docutils.ErrorString() 2025-10-23 16:24:19 +02:00
drivers ixgbevf: fix mailbox API compatibility by negotiating supported features 2025-10-23 16:24:20 +02:00
fs smb: client: Fix refcount leak for cifs_sb_tlink 2025-10-23 16:24:21 +02:00
include ata: libata-core: relax checks in ata_read_log_directory() 2025-10-23 16:24:20 +02:00
init init: handle bootloader identifier in kernel parameters 2025-10-19 16:37:27 +02:00
io_uring io_uring/zcrx: increment fallback loop src offset 2025-10-19 16:37:14 +02:00
ipc vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
kernel pid: Add a judgment for ns null in pid_nr_ns 2025-10-19 16:37:43 +02:00
lib lib/genalloc: fix device leak in of_gen_pool_get() 2025-10-19 16:37:28 +02:00
LICENSES LICENSES: Replace the obsolete address of the FSF in the GFDL-1.2 2025-07-24 11:15:39 +02:00
mm slab: reset slab->obj_ext when freeing and it is OBJEXTS_ALLOC_FAIL 2025-10-23 16:24:21 +02:00
net mptcp: reset blackhole on success with non-loopback ifaces 2025-10-19 16:37:36 +02:00
rust cpufreq: Make drivers using CPUFREQ_ETERNAL specify transition latency 2025-10-19 16:37:00 +02:00
samples 15 hotfixes. 11 are cc:stable and the remainder address post-6.16 issues 2025-09-17 21:34:26 -07:00
scripts kbuild: Add '.rel.*' strip pattern for vmlinux 2025-10-19 16:37:15 +02:00
security KEYS: trusted_tpm1: Compare HMAC values in constant time 2025-10-19 16:37:28 +02:00
sound ASoC: SOF: Intel: Read the LLP via the associated Link DMA channel 2025-10-19 16:37:09 +02:00
tools selftests: mptcp: join: validate C-flag + def limit 2025-10-19 16:37:36 +02:00
usr usr/include: openrisc: don't HDRTEST bpf_perf_event.h 2025-05-12 15:03:17 +09:00
virt Merge tag 'kvm-x86-no_assignment-6.17' of https://github.com/kvm-x86/linux into HEAD 2025-07-29 08:36:42 -04:00
.clang-format Linux 6.15-rc5 2025-05-06 16:39:25 +10:00
.clippy.toml rust: clean Rust 1.88.0's warning about clippy::disallowed_macros configuration 2025-05-07 00:11:47 +02:00
.cocciconfig
.editorconfig
.get_maintainer.ignore MAINTAINERS: remove Alyssa Rosenzweig 2025-09-18 21:17:31 +02:00
.gitattributes
.gitignore gitignore: allow .pylintrc to be tracked 2025-07-02 17:10:04 -06:00
.mailmap 7 hotfixes. 4 are cc:stable and the remainder address post-6.16 issues or 2025-09-28 09:32:00 -07:00
.pylintrc docs: add a .pylintrc file with sys path for docs scripts 2025-04-09 12:10:33 -06:00
.rustfmt.toml
COPYING
CREDITS MAINTAINERS: retire Boris from TLS maintainers 2025-08-26 17:36:01 -07:00
Kbuild
Kconfig
MAINTAINERS i2c-for-6.17-rc8 2025-09-28 13:19:23 -07:00
Makefile Linux 6.17.4 2025-10-19 16:37:45 +02:00
README

Linux kernel

There are several guides for kernel developers and users. These guides can be rendered in a number of formats, like HTML and PDF. Please read Documentation/admin-guide/README.rst first.

In order to build the documentation, use make htmldocs or make pdfdocs. The formatted documentation can also be read online at:

https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory, several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the requirements for building and running the kernel, and information about the problems which may result by upgrading your kernel.