Re: [PATCH bpf RESEND 1/2] bpf: Check the remaining info_cnt before repeating btf fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2024-10-09 at 15:12 +0800, Hou Tao wrote:

[...]

> I don't think they are the same. The main reason is due to the check in
> the beginning of btf_repeat_field():
> 
>         /* Ensure not repeating fields that should not be repeated. */
>         for (i = 0; i < field_cnt; i++) {
>                 switch (info[i].type) {
> 
> There are two cases here:
> 1) info_cnt == 0
> Because info_cnt is 0, the found record isn't saved in info[0], the
> check will be incorrect
> 
> 2) nelements ==1 && info_cnt > 0
> If the found record is bpf_timer or similar, btf_repeat_fields() will
> return -EINVAL instead of 0.

Oh, right, there is a loop accessing 'info' at the start.
Sorry for the noise.






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux