mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 12:16:41 +00:00
UBI: fix nameless volumes handling
commit 4a59c797a1
upstream.
Currently it's possible to create a volume without a name. E.g:
ubimkvol -n 32 -s 2MiB -t static /dev/ubi0 -N ""
After that vtbl_check() will always fail because it does not permit
empty strings.
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
This commit is contained in:
parent
2533c024c6
commit
2e9633af99
@ -569,6 +569,9 @@ static int verify_mkvol_req(const struct ubi_device *ubi,
|
||||
if (req->alignment != 1 && n)
|
||||
goto bad;
|
||||
|
||||
if (!req->name[0] || !req->name_len)
|
||||
goto bad;
|
||||
|
||||
if (req->name_len > UBI_VOL_NAME_MAX) {
|
||||
err = -ENAMETOOLONG;
|
||||
goto bad;
|
||||
|
Loading…
Reference in New Issue
Block a user