Message ID | 1326463660-17852-1-git-send-email-richard@nod.at |
---|---|
State | Accepted |
Commit | 4a59c797a18917a5cf3ff7ade296b46134d91e6a |
Headers | show |
On Fri, 2012-01-13 at 15:07 +0100, Richard Weinberger wrote: > 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. > > Cc: <stable@vger.kernel.org> > Signed-off-by: Richard Weinberger <richard@nod.at> Well-spotted, thank you! I'll send it to Linus soon, as well as the other patch of yours. Artem.
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index 3320a50..ad76592 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c @@ -632,6 +632,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;
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. Cc: <stable@vger.kernel.org> Signed-off-by: Richard Weinberger <richard@nod.at> --- drivers/mtd/ubi/cdev.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)