On 4/12/24 12:08, Eduard Zingerman wrote:
On Fri, 2024-04-12 at 09:32 -0700, Kui-Feng Lee wrote:
On 4/11/24 15:14, Eduard Zingerman wrote:
On Tue, 2024-04-09 at 17:41 -0700, Kui-Feng Lee wrote:
[...]
Any access to elements other than the first one would be rejected.
I'm not sure this is true, could you please point me to a specific
check in the code that enforces access to go to the first element?
The check added in this patch only enforces correct alignment with
array element start.
I mean accessing to elements other than the first one would be rejected
if we don't have this patch.
Oh, I misunderstood the above statement then.
The way I read it was: "after this patch access to elements other than
the first one would be rejected". While this patch explicitly allows
access to the subsequent array elements, hence confusion.
Sorry for the noise.
I will rephrase it to make it more clear.
Before the change, it enforces correct alignment with the start of the
whole array. Once the array feature is enabled, the "size" of struct
btf_field will be the size of entire array. In another word, accessing
to later elements, other than the first one, doesn't align with the
beginning of entire array, and will be rejected.