Description
In the Linux kernel, the following vulnerability has been resolved: bpf: Check the offset in bpf_skb_generic_{push,pop}() To make room for len bytes at offset off, bpf_skb_generic_push() moves the first off bytes and clears len bytes after them. It assumes that the first off bytes are in the linear part. But in bpf_skb_adjust_room() off can be the end of the IP header, and this header can be in a frag. Then the function reads and writes after skb->tail, and can damage skb_shared_info. bpf_skb_generic_pop() checks off + len, but this u32 sum can wrap to a small value. bpf_skb_adjust_room() and bpf_skb_change_proto() calculate off from skb_mac_header_len(). This length is a very large u32 when network_header < mac_header. Then the check can pass, and memmove() reads and writes far outside the skb. Return -ENOMEM from both functions, like the present check, when off > skb->len. Thus the sum cannot wrap. In bpf_skb_generic_push() also pull the first off bytes into the linear part. Now bpf_skb_adjust_room() fails when a prog grows an skb that ends before off. network_header stays wrong.
Affected products
Version statuses are supplied by the assigning organization. Consult the original record for detailed ranges and platform conditions.
Linux Linux
Default version status: unaffected
6578171a7ff0c31dc73258f93da7407510abf085 to < 71b7211ea168c19fdc8871a886cf6b738a6c9764affected6578171a7ff0c31dc73258f93da7407510abf085 to < b6e295b06d6ebe0d5459661b55627fdb9c238fd4affected6578171a7ff0c31dc73258f93da7407510abf085 to < 280c120c9dac35f7a22589303cc90b8a00e6fde8affected6578171a7ff0c31dc73258f93da7407510abf085 to < ee36c9aa44ef300cd651074bd97552b229337f85affected
Linux Linux
Default version status: affected
4.8affected0 to < 4.8unaffected6.12.120 to ≤ 6.12.*unaffected6.18.66 to ≤ 6.18.*unaffected7.3.7 to ≤ 7.3.*unaffected7.4-rc2 to ≤ *unaffected