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: <20090116235706.GK13929@webber.adilger.int>
Date:	Sat, 17 Jan 2009 07:57:06 +0800
From:	Andreas Dilger <adilger@....com>
To:	"Theodore Ts'o" <tytso@....edu>
Cc:	Ext4 Developers List <linux-ext4@...r.kernel.org>,
	stable@...nel.org
Subject: Re: [PATCH, RFC] ext4: ignore i_size_high for directories

On Jan 16, 2009  11:59 -0500, Theodore Ts'o wrote:
> Directories are not allowed to be bigger than 2TB, so don't use

... bigger than 2GB?

> i_size_high when reading the inode.  E2fsck should complain about
> these inodes, but the simplest thing to do for the kernel is simply to
> not consult i_size_high for directory inodes.

Actually, it would be preferable to allow directories to grow beyond
the 2GB limit.  2GB only allows about 30M files.  While the htree code
is currently limited to only 2 levels deep, if you have 8kB+ block
size it is possible to have directories larger than 2GB with only
2 levels of htree.

>  static inline loff_t ext4_isize(struct ext4_inode *raw_inode)
>  {
> +	if (S_ISDIR(le16_to_cpu(raw_inode->i_mode)))
> +		return (loff_t) le32_to_cpu(raw_inode->i_size_lo);
> +	else
> +		return ((loff_t)le32_to_cpu(raw_inode->i_size_high) << 32) |
> +			le32_to_cpu(raw_inode->i_size_lo);

If you are going to limit this it should be "if (!S_ISREG(...))"
instead of "if (S_ISDIR(...))" because none of the special files
should use i_size_high - e2fsck will clear a special inode if
it has a non-zero size.

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

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ