]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
afs: Fix premature cell exposure through /afs
authorDavid Howells <dhowells@redhat.com>
Mon, 22 Jun 2026 09:08:53 +0000 (10:08 +0100)
committerChristian Brauner <brauner@kernel.org>
Wed, 1 Jul 2026 13:26:22 +0000 (15:26 +0200)
commit26f17ce6fa3f05cb5965790499c1839094260de4
tree9fdf6bca2824620aae2243f91fc9c75a1c535572
parent55e841836c6f4646490f7b0347192b7a92d431ba
afs: Fix premature cell exposure through /afs

AFS cell records are prematurely exposured through the /afs dynamic root by
virtue of adding them immediately to the net->cells_dyn_ino IDR when the
cell is allocated rather than when it is added to the lookup tree.  This
allows a candidate record to be accessed, even if it's actually a duplicate
or not published yet.

Fix this by not adding the cell to cells_dyn_ino until it's confirmed
non-duplicate and is being published.  A flag is then used to record
whether it is added to the IDR to make removal from the IDR conditional.

Closes: https://sashiko.dev/#/patchset/20260618155141.2513212-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/20260622090856.2746629-20-dhowells@redhat.com
Fixes: 1d0b929fc070 ("afs: Change dynroot to create contents on demand")
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/afs/cell.c
fs/afs/internal.h