Re: [PATCH bpf 2/4] bpf: Zero ARG_PTR_TO_{LONG,INT} | MEM_UNINIT args in case of error

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

 



On Fri, Aug 23, 2024 at 3:20 PM Daniel Borkmann <daniel@xxxxxxxxxxxxx> wrote:

> diff --git a/net/core/filter.c b/net/core/filter.c
> index 2ff210cb068c..a25c32da3d6c 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -6264,6 +6264,8 @@ BPF_CALL_5(bpf_skb_check_mtu, struct sk_buff *, skb,
>         int skb_len, dev_len;
>         int mtu;
>
> +       *mtu_len = 0;
> +
>         if (unlikely(flags & ~(BPF_MTU_CHK_SEGS)))
>                 return -EINVAL;
>
> @@ -6313,6 +6315,8 @@ BPF_CALL_5(bpf_xdp_check_mtu, struct xdp_buff *, xdp,
>         int ret = BPF_MTU_CHK_RET_SUCCESS;
>         int mtu, dev_len;
>
> +       *mtu_len = 0;
> +
>         /* XDP variant doesn't support multi-buffer segment check (yet) */
>         if (unlikely(flags))
>                 return -EINVAL;

This looks wrong.
If selftests are not failing because of that they should.





[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