All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 6.1 01/17] 9p: Avoid creating multiple slab caches with the same name
@ 2024-10-23 14:31 Sasha Levin
  2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 02/17] irqchip/ocelot: Fix trigger register address Sasha Levin
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: Sasha Levin @ 2024-10-23 14:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Pedro Falcato, syzbot+3c5d43e97993e1fa612b, Dominique Martinet,
	Sasha Levin, ericvh, lucho, v9fs

From: Pedro Falcato <pedro.falcato@gmail.com>

[ Upstream commit 79efebae4afc2221fa814c3cae001bede66ab259 ]

In the spirit of [1], avoid creating multiple slab caches with the same
name. Instead, add the dev_name into the mix.

[1]: https://lore.kernel.org/all/20240807090746.2146479-1-pedro.falcato@gmail.com/

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
Reported-by: syzbot+3c5d43e97993e1fa612b@syzkaller.appspotmail.com
Message-ID: <20240807094725.2193423-1-pedro.falcato@gmail.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/9p/client.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/net/9p/client.c b/net/9p/client.c
index 0fc2d706d9c23..18db0e23e2f15 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -969,6 +969,7 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
 	int err;
 	struct p9_client *clnt;
 	char *client_id;
+	char *cache_name;
 
 	err = 0;
 	clnt = kmalloc(sizeof(*clnt), GFP_KERNEL);
@@ -1026,15 +1027,22 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
 	if (err)
 		goto close_trans;
 
+	cache_name = kasprintf(GFP_KERNEL, "9p-fcall-cache-%s", dev_name);
+	if (!cache_name) {
+		err = -ENOMEM;
+		goto close_trans;
+	}
+
 	/* P9_HDRSZ + 4 is the smallest packet header we can have that is
 	 * followed by data accessed from userspace by read
 	 */
 	clnt->fcall_cache =
-		kmem_cache_create_usercopy("9p-fcall-cache", clnt->msize,
+		kmem_cache_create_usercopy(cache_name, clnt->msize,
 					   0, 0, P9_HDRSZ + 4,
 					   clnt->msize - (P9_HDRSZ + 4),
 					   NULL);
 
+	kfree(cache_name);
 	return clnt;
 
 close_trans:
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-10-23 14:32 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-23 14:31 [PATCH AUTOSEL 6.1 01/17] 9p: Avoid creating multiple slab caches with the same name Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 02/17] irqchip/ocelot: Fix trigger register address Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 03/17] nvme: tcp: avoid race between queue_lock lock and destroy Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 04/17] block: Fix elevator_get_default() checking for NULL q->tag_set Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 05/17] HID: multitouch: Add support for B2402FVA track point Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 06/17] HID: multitouch: Add quirk for HONOR MagicBook Art 14 touchpad Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 07/17] nvme: disable CC.CRIME (NVME_CC_CRIME) Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 08/17] bpf: use kvzmalloc to allocate BPF verifier environment Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 09/17] crypto: api - Fix liveliness check in crypto_alg_tested Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 10/17] crypto: marvell/cesa - Disable hash algorithms Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 11/17] sound: Make CONFIG_SND depend on INDIRECT_IOMEM instead of UML Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 12/17] drm/vmwgfx: Limit display layout ioctl array size to VMWGFX_NUM_DISPLAY_UNITS Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 13/17] arm64: set POR_EL0 for kernel threads Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 14/17] kasan: Disable Software Tag-Based KASAN with GCC Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 15/17] nvme-multipath: defer partition scanning Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 16/17] powerpc/powernv: Free name on error in opal_event_init() Sasha Levin
2024-10-23 14:31 ` [PATCH AUTOSEL 6.1 17/17] nvme: make keep-alive synchronous operation Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.