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] [day] [month] [year] [list]
Message-ID: <87efb79squ.fsf@mail.parknet.co.jp>
Date:   Tue, 27 Nov 2018 11:08:57 +0900
From:   OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     Carmeli Tamir <carmeli.tamir@...il.com>, axboe@...nel.dk,
        sergey.senozhatsky@...il.com, jthumshirn@...e.de,
        bvanassche@....org, martin.petersen@...cle.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fat: Replaced 11 magic to MSDOS_NAME for volume label

Carmeli Tamir <carmeli.tamir@...il.com> writes:

> The FAT file system volume label file stored in the root directory should
> match the volume label field in the FAT boot sector. As consequence, the
> max length of these fields ought to be the same. This patch replaces the
> magic '11' usef in the struct fat_boot_sector with MSDOS_NAME,
> which is used in struct msdos_dir_entry.
>
> Please check the following references:
> 1. Microsoft FAT specification 2005 
> (http://read.pudn.com/downloads77/ebook/294884/FAT32%20Spec%20%28SDA%20Contribution%29.pdf).
> Search for 'volume label'.
> 2. Microsoft Extensible Firmware Initiative, FAT32 File System Specification
> (https://staff.washington.edu/dittrich/misc/fatgen103.pdf). 
> Search for 'volume label'.
> 3. User space code that creates FAT filesystem 
> sometimes uses MSDOS_NAME for the label, sometimes not.
> Search for 'if (memcmp(label, NO_NAME, MSDOS_NAME))'. 
> I consider to make the same patch there as well.
> https://github.com/dosfstools/dosfstools/blob/master/src/mkfs.fat.c
>
> Signed-off-by: Carmeli Tamir <carmeli.tamir@...il.com>

Reviewed-by: Johannes Thumshirn <jthumshirn@...e.de>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Acked-by: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>

Looks good. Thanks.

> ---
>  include/uapi/linux/msdos_fs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/uapi/linux/msdos_fs.h b/include/uapi/linux/msdos_fs.h
> index fde7537..1216e6c 100644
> --- a/include/uapi/linux/msdos_fs.h
> +++ b/include/uapi/linux/msdos_fs.h
> @@ -135,7 +135,7 @@ struct fat_boot_sector {
>  						   for mount state. */
>  			__u8	signature;  /* extended boot signature */
>  			__u8	vol_id[4];	/* volume ID */
> -			__u8	vol_label[11];	/* volume label */
> +			__u8	vol_label[MSDOS_NAME];	/* volume label */
>  			__u8	fs_type[8];		/* file system type */
>  			/* other fields are not added here */
>  		} fat16;
> @@ -158,7 +158,7 @@ struct fat_boot_sector {
>  						   for mount state. */
>  			__u8	signature;  /* extended boot signature */
>  			__u8	vol_id[4];	/* volume ID */
> -			__u8	vol_label[11];	/* volume label */
> +			__u8	vol_label[MSDOS_NAME];	/* volume label */
>  			__u8	fs_type[8];		/* file system type */
>  			/* other fields are not added here */
>  		} fat32;

-- 
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ