Re: [PATCH bpf-next 1/7] bpf: Create links for BPF struct_ops maps.

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

 




On 2/15/23 12:30, Martin KaFai Lau wrote:
On 2/15/23 10:04 AM, Kui-Feng Lee wrote:
+    int err;
+
+    map = bpf_map_get(attr->link_create.prog_fd);

bpf_map_get can fail here?


We have already verified the `attach_type` of the link before calling this function, so an error should not occur. If it does happen, however, something truly unusual must be happening. To ensure maximum protection and avoid this issue in the future, I will add a check here as well.

bpf_map_get() could fail. A valid attach_type does not mean prog_fd (actually map_fd here) is also valid.

You are right! I must mess up with the update one.

I will add a check.





[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