lkml.org 
[lkml]   [2012]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[052/129] UBI: fix nameless volumes handling
    3.2-stable review patch.  If anyone has any objections, please let me know.

    ------------------
    Content-Length: 843
    Lines: 31

    From: Richard Weinberger <richard@nod.at>

    commit 4a59c797a18917a5cf3ff7ade296b46134d91e6a 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>

    ---
    drivers/mtd/ubi/cdev.c | 3 +++
    1 file changed, 3 insertions(+)

    --- a/drivers/mtd/ubi/cdev.c
    +++ b/drivers/mtd/ubi/cdev.c
    @@ -632,6 +632,9 @@ static int verify_mkvol_req(const struct
    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;



    \
     
     \ /
      Last update: 2012-01-24 03:49    [W:2.516 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site