afs: Fix storage of cell names
authorDavid Howells <dhowells@redhat.com>
Wed, 24 Jun 2020 16:00:24 +0000 (17:00 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 28 Jun 2020 05:04:24 +0000 (22:04 -0700)
commit719fdd32921fb7e3208db8832d32ae1c2d68900f
tree1a1d38128ee5fefc95a70083684688ce5aaeb557
parent916a3b0fc1206f7e7ae8d00a21a3114b1dc67794
afs: Fix storage of cell names

The cell name stored in the afs_cell struct is a 64-char + NUL buffer -
when it needs to be able to handle up to AFS_MAXCELLNAME (256 chars) + NUL.

Fix this by changing the array to a pointer and allocating the string.

Found using Coverity.

Fixes: 989782dcdc91 ("afs: Overhaul cell database management")
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/afs/cell.c
fs/afs/internal.h