]> git.hungrycats.org Git - linux/commit
afs: Increase buffer size in afs_update_volume_status()
authorDaniil Dulov <d.dulov@aladdin.ru>
Mon, 19 Feb 2024 14:39:03 +0000 (14:39 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:26:36 +0000 (13:26 +0100)
commite8530b170e464017203e3b8c6c49af6e916aece1
tree78bb3183169524f486ace61bfd69fe83d0451990
parentaddf5e297e6cbf5341f9c07720693ca9ba0057b5
afs: Increase buffer size in afs_update_volume_status()

[ Upstream commit 6ea38e2aeb72349cad50e38899b0ba6fbcb2af3d ]

The max length of volume->vid value is 20 characters.
So increase idbuf[] size up to 24 to avoid overflow.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

[DH: Actually, it's 20 + NUL, so increase it to 24 and use snprintf()]

Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation")
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/20240211150442.3416-1-d.dulov@aladdin.ru/
Link: https://lore.kernel.org/r/20240212083347.10742-1-d.dulov@aladdin.ru/
Link: https://lore.kernel.org/r/20240219143906.138346-3-dhowells@redhat.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/afs/volume.c