afs: Fix storage of cell names
authorDavid Howells <dhowells@redhat.com>
Wed, 24 Jun 2020 16:00:24 +0000 (17:00 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 30 Jun 2020 19:36:12 +0000 (15:36 -0400)
commit53ca39914c1cda0bebfabf36c2c50137947342a3
treeb096326f4e12b06cd0e0aae25c9151796e01e70e
parentc275f248df02ea3e8aab4a144467cc28682eaae5
afs: Fix storage of cell names

[ Upstream commit 719fdd32921fb7e3208db8832d32ae1c2d68900f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/afs/cell.c
fs/afs/internal.h