WSL2-Linux-Kernel/include/uapi
Jakub Sitnicki 0c64645e63 bpf: Make remote_port field in struct bpf_sk_lookup 16-bit wide
commit 9a69e2b385 upstream.

remote_port is another case of a BPF context field documented as a 32-bit
value in network byte order for which the BPF context access converter
generates a load of a zero-padded 16-bit integer in network byte order.

First such case was dst_port in bpf_sock which got addressed in commit
4421a58271 ("bpf: Make dst_port field in struct bpf_sock 16-bit wide").

Loading 4-bytes from the remote_port offset and converting the value with
bpf_ntohl() leads to surprising results, as the expected value is shifted
by 16 bits.

Reduce the confusion by splitting the field in two - a 16-bit field holding
a big-endian integer, and a 16-bit zero-padding anonymous field that
follows it.

Suggested-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220209184333.654927-2-jakub@cloudflare.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-13 20:59:25 +02:00
..
asm-generic aio: fix use-after-free due to missing POLLFREE handling 2021-12-14 10:57:15 +01:00
drm drm/tegra: Changes for v5.15-rc1 2021-08-26 13:05:19 +10:00
linux bpf: Make remote_port field in struct bpf_sk_lookup 16-bit wide 2022-04-13 20:59:25 +02:00
misc habanalabs: fix resetting args in wait for CS IOCTL 2021-09-29 12:18:48 +03:00
mtd mtd: add OTP (one-time-programmable) erase ioctl 2021-03-28 19:24:54 +02:00
rdma Merge branch 'sg_nents' into rdma.git for-next 2021-08-30 09:49:59 -03:00
scsi scsi: fc: Add EDC ELS definition 2021-08-24 22:56:33 -04:00
sound ASoC: hdmi-codec: Fix OOB memory accesses 2022-02-08 18:34:03 +01:00
video
xen
Kbuild