]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tee: shm: Remove refcounting of kernel pages
authorMatthew Wilcox <willy@infradead.org>
Fri, 20 Feb 2026 08:49:59 +0000 (14:19 +0530)
committerJens Wiklander <jens.wiklander@linaro.org>
Tue, 3 Mar 2026 08:03:04 +0000 (09:03 +0100)
commit08d9a4580f71120be3c5b221af32dca00a48ceb0
tree2e58017e13587fd0d053bb50df437c72bdb85c1a
parent6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
tee: shm: Remove refcounting of kernel pages

Earlier TEE subsystem assumed to refcount all the memory pages to be
shared with TEE implementation to be refcounted. However, the slab
allocations within the kernel don't allow refcounting kernel pages.

It is rather better to trust the kernel clients to not free pages while
being shared with TEE implementation. Hence, remove refcounting of kernel
pages from register_shm_helper() API.

Fixes: b9c0e49abfca ("mm: decline to manipulate the refcount on a slab page")
Reported-by: Marco Felsch <m.felsch@pengutronix.de>
Reported-by: Sven Püschel <s.pueschel@pengutronix.de>
Signed-off-by: Matthew Wilcox <willy@infradead.org>
Co-developed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Tested-by: Sven Püschel <s.pueschel@pengutronix.de>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/tee/tee_shm.c