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  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]
Date:   Fri, 24 May 2019 14:11:34 +0800
From:   "" <>
To:     Jan Kara <>
Subject: Re: [PATCH] ext2: strengthen value length check in ext2_xattr_set()

On Wed, 2019-05-22 at 11:50 +0200, Jan Kara wrote:
> On Wed 22-05-19 16:28:46, Chengguang Xu wrote:
> > Actually maximum length of a valid entry value is not
> > ->s_blocksize because header, last entry and entry
> > name will also occupy some spaces. This patch
> > strengthens the value length check and return -ERANGE
> > when the length is larger than allowed maximum length.
> > 
> > Signed-off-by: Chengguang Xu <>
> Thanks for the patch! But what's the point of this change? We would return
> ERANGE instead of ENOSPC? I don't think that's serious enough to warrant
> changing existing behavior...

Hi Jan,

Instead of adding the check here, I propose to change value
size limit check in ext2_xattr_entry_valid().

size = le32_to_cpu(entry->e_value_size);
if (size > end_offs ||
    le16_to_cpu(entry->e_value_offs) + size > end_offs)

Change to

size = EXT2_XATTR_SIZE(le32_to_cpu(entry->e_value_size));
if (size >= end_offs - sizeof(struct ext2_xattr_header) - sizeof(__u32) ||
    le16_to_cpu(entry->e_value_offs) + size > end_offs)

Will you agree this change?


Powered by blists - more mailing lists