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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <20090518163221.GE3144@webber.adilger.int>
Date:	Mon, 18 May 2009 10:32:21 -0600
From:	Andreas Dilger <adilger@....com>
To:	Jan Blunck <jblunck@...e.de>
Cc:	viro@...iv.linux.org.uk, bharata@...ibm.com, dwmw2@...radead.org,
	mszeredi@...e.cz, vaurora@...hat.com, linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 30/32] union mount: ext2 fallthru support

On May 18, 2009  18:09 +0200, Jan Blunck wrote:
> diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
> index bd10826..f6b68ec 100644
> --- a/include/linux/ext2_fs.h
> +++ b/include/linux/ext2_fs.h
> @@ -577,6 +577,7 @@ enum {
>  	EXT2_FT_SOCK,
>  	EXT2_FT_SYMLINK,
>  	EXT2_FT_WHT,
> +	EXT2_FT_FALLTHRU,
>  	EXT2_FT_MAX

The EXT2_FT_WHT is not declared in e2fsprogs::lib/ext2fs/ext2_fs.h
so you risk hitting a conflict here if someone isn't looking at
the "should be left alone" ext2 code.  Secondly, it is somewhat
dangerous to use a straight enum here, because this will reassign
values of later variables if one of the earlier ones is removed.

For enums like this that require specific constant on-disk values
I prefer being safe:

enum {
	EXT2_FT_UNKNOWN  = 0,
	EXT2_FT_REG_FILE = 1,
	EXT2_FT_DIR	 = 2,
	EXT2_FT_CHRDEV   = 3,
	EXT2_FT_BLKDEV   = 4,
	EXT2_FT_FIFO     = 5,
	EXT2_FT_SOCK     = 6,
	EXT2_FT_SYMLINK  = 7,
	EXT2_FT_WHT      = 8,
	EXT2_FT_FALLTHRU = 9,
 	EXT2_FT_MAX


It probably also makes sense to include a patch for ext3/ext4 to ensure
these values are not used by some unrelated feature.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

--
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