Re: [PATCH v3] net: bpf: permit redirect from ingress L3 to egress L2 devices at near max mtu

2020-05-07 Thread Daniel Borkmann
On 5/7/20 6:46 PM, Maciej Żenczykowski wrote: (a) not clear why the max is SKB_MAX_ALLOC in the first place (this is PAGE_SIZE << 2, ie. 16K on x86), while lo mtu is 64k Agreed, tbh, it's not clear to me either atm. :) The SKB_MAX_ALLOC constant itself should be replaced with something more

Re: [PATCH v3] net: bpf: permit redirect from ingress L3 to egress L2 devices at near max mtu

2020-05-07 Thread Maciej Żenczykowski
(a) not clear why the max is SKB_MAX_ALLOC in the first place (this is PAGE_SIZE << 2, ie. 16K on x86), while lo mtu is 64k (b) hmm, if we're not redirecting, then exceeding the ingress device's mtu doesn't seem to be a problem. Indeed AFAIK this can already happen, some devices will round mtu

Re: [PATCH v3] net: bpf: permit redirect from ingress L3 to egress L2 devices at near max mtu

2020-05-07 Thread Daniel Borkmann
On 5/7/20 4:36 AM, Maciej Żenczykowski wrote: From: Maciej Żenczykowski __bpf_skb_max_len(skb) is used from: bpf_skb_adjust_room __bpf_skb_change_tail __bpf_skb_change_head but in the case of forwarding we're likely calling these functions during receive processing on ingress and

[PATCH v3] net: bpf: permit redirect from ingress L3 to egress L2 devices at near max mtu

2020-05-06 Thread Maciej Żenczykowski
From: Maciej Żenczykowski __bpf_skb_max_len(skb) is used from: bpf_skb_adjust_room __bpf_skb_change_tail __bpf_skb_change_head but in the case of forwarding we're likely calling these functions during receive processing on ingress and bpf_redirect()'ing at a later point in time to egress