lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABqD9hYw3qcMpcjyEtvstYD-WRB=QkVPS5S0MBbah=veZv9E6A@mail.gmail.com>
Date:	Wed, 5 Oct 2011 09:41:36 -0500
From:	Will Drewry <wad@...omium.org>
To:	Rabin Vincent <rabin@....in>
Cc:	axboe@...nel.dk, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] block: fix UUID string buffer length

On Wed, Oct 5, 2011 at 4:52 AM, Rabin Vincent <rabin@....in> wrote:
> The UUID string buffer is several bytes shorter than what is actually
> required, because the space for the hyphens hasn't been taken into
> account.  Fix it, while also making it a regular char[] rather than a
> u8[] to make it clear what we're storing here.
>
> Cc: Will Drewry <wad@...omium.org>
> Signed-off-by: Rabin Vincent <rabin@....in>

You're absolutely right. It should match the sizeof used by sprintf's
calculation of the uuid string.
( http://lxr.linux.no/linux+v3.0.4/lib/vsprintf.c#L759 ).  The type
change is also entirely appropriate (even given the prototype of
part_unpack_uuid).

Thanks!

Reviewed-by: Will Drewry <wad@...omium.org>

> ---
>  block/genhd.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/block/genhd.c b/block/genhd.c
> index 8dfa21e..fa955b5 100644
> --- a/block/genhd.c
> +++ b/block/genhd.c
> @@ -736,7 +736,7 @@ void __init printk_all_partitions(void)
>                struct hd_struct *part;
>                char name_buf[BDEVNAME_SIZE];
>                char devt_buf[BDEVT_SIZE];
> -               u8 uuid[PARTITION_META_INFO_UUIDLTH * 2 + 1];
> +               char uuid[sizeof("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")];
>
>                /*
>                 * Don't show empty devices or things that have been
> @@ -755,7 +755,7 @@ void __init printk_all_partitions(void)
>                while ((part = disk_part_iter_next(&piter))) {
>                        bool is_part0 = part == &disk->part0;
>
> -                       uuid[0] = 0;
> +                       uuid[0] = '\0';
>                        if (part->info)
>                                part_unpack_uuid(part->info->uuid, uuid);
>
> --
> 1.7.5.4
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ