]> www.infradead.org Git - users/dwmw2/linux.git/commit
9p: fix slab cache name creation for real
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 21 Oct 2024 18:57:38 +0000 (11:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 21 Oct 2024 22:41:29 +0000 (15:41 -0700)
commita360f311f57a36e96d88fa8086b749159714dcd2
tree8b05e0929f73f69e55af2a12889ea893108e8cea
parentd129377639907fce7e0a27990e590e4661d3ee02
9p: fix slab cache name creation for real

This was attempted by using the dev_name in the slab cache name, but as
Omar Sandoval pointed out, that can be an arbitrary string, eg something
like "/dev/root".  Which in turn trips verify_dirent_name(), which fails
if a filename contains a slash.

So just make it use a sequence counter, and make it an atomic_t to avoid
any possible races or locking issues.

Reported-and-tested-by: Omar Sandoval <osandov@fb.com>
Link: https://lore.kernel.org/all/ZxafcO8KWMlXaeWE@telecaster.dhcp.thefacebook.com/
Fixes: 79efebae4afc ("9p: Avoid creating multiple slab caches with the same name")
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Dominique Martinet <asmadeus@codewreck.org>
Cc: Thorsten Leemhuis <regressions@leemhuis.info>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
net/9p/client.c