The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2] afs: Increase buffer size in afs_update_volume_status()
@ 2024-02-12  8:33 Daniil Dulov
  2024-02-12 14:56 ` Jeffrey E Altman
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Daniil Dulov @ 2024-02-12  8:33 UTC (permalink / raw)
  To: Jeffrey E Altman
  Cc: Daniil Dulov, linux-afs, Marc Dionne, David Howells, linux-kernel,
	lvc-project

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

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

Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation")
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
---
 fs/afs/volume.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/afs/volume.c b/fs/afs/volume.c
index 020ecd45e476..d4a379bfd54e 100644
--- a/fs/afs/volume.c
+++ b/fs/afs/volume.c
@@ -353,7 +353,7 @@ static int afs_update_volume_status(struct afs_volume *volume, struct key *key)
 {
 	struct afs_server_list *new, *old, *discard;
 	struct afs_vldb_entry *vldb;
-	char idbuf[16];
+	char idbuf[20];
 	int ret, idsz;
 
 	_enter("");
-- 
2.25.1


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

end of thread, other threads:[~2024-02-19 16:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-12  8:33 [PATCH v2] afs: Increase buffer size in afs_update_volume_status() Daniil Dulov
2024-02-12 14:56 ` Jeffrey E Altman
2024-02-19 10:28 ` David Howells
2024-02-19 10:33 ` David Howells
2024-02-19 15:07   ` Daniil Dulov
2024-02-19 16:01     ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox