[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D9967EB7-7F4D-4122-9470-DB14700FD906@gmail.com>
Date: Fri, 2 May 2025 01:28:28 +0800
From: Alan Huang <mmpgouride@...il.com>
To: Jan Hendrik Farr <kernel@...rr.cc>
Cc: kent.overstreet@...ux.dev,
Thorsten Blum <thorsten.blum@...lux.com>,
Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Nathan Chancellor <nathan@...nel.org>,
Bill Wendling <morbo@...gle.com>,
Kees Cook <kees@...nel.org>,
regressions@...ts.linux.dev,
linux-bcachefs@...r.kernel.org,
linux-hardening@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
ardb@...nel.org,
ojeda@...nel.org
Subject: Re: [REGRESSION][BISECTED] erroneous buffer overflow detected in
bch2_xattr_validate
Thanks,
Alan
> On May 2, 2025, at 01:22, Jan Hendrik Farr <kernel@...rr.cc> wrote:
>
>>
>> I wonder if the __counted_by(x_name_len) in struct bch_xattr is needed, since there is also a value after x_name.
>
> Wait a minute. Are you saying that the value with length x_val_len
> is behind the name (of length x_name_len) at the end of the struct.
> So essentially the flexible array member x_name has a length of
> x_name_len + x_val_len and contains both the name and value?
Yes.
>
> If that's the case:
>
> 1. that's not at all clear from the struct definition
> 2. __counted_by(x_name_len) is not correct in that case
>
Both clang and gcc say:
• p->array has at least p->count number of elements available all the time.
Note the at least here. Though I think the counted_by is misleading here.
>
> Best Regards
> Jan
Powered by blists - more mailing lists