linux-stable/include
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
..
acpi ACPICA: actypes.h: Expand the ACPI_ACCESS_ definitions 2022-01-27 11:04:49 +01:00
asm-generic bitops: protect find_first_{,zero}_bit properly 2022-01-27 11:05:34 +01:00
clocksource
crypto
drm drm/connector: Fix typo in documentation 2022-04-08 14:24:12 +02:00
dt-bindings
keys
kunit kunit: fix kernel-doc warnings due to mismatched arg names 2021-10-06 17:54:07 -06:00
kvm KVM: arm64: Fix PMU probe ordering 2021-09-20 12:43:34 +01:00
linux gpio: Restrict usage of GPIO chip irq members before initialization 2022-04-13 20:59:23 +02:00
math-emu
media media: cec: fix a deadlock situation 2022-01-27 11:02:53 +01:00
memory memory: renesas-rpc-if: Correct QSPI data transfer in Manual mode 2021-11-18 19:16:01 +01:00
misc
net Bluetooth: Fix not checking for valid hdev on bt_dev_{info,warn,err,dbg} 2022-04-13 20:59:08 +02:00
pcmcia
ras
rdma RDMA/netlink: Add __maybe_unused to static inline in C file 2021-11-25 09:49:07 +01:00
scsi scsi: core: sd: Add silence_suspend flag to suppress some PM messages 2022-04-08 14:22:54 +02:00
soc net: dsa: tag_ocelot_8021q: break circular dependency with ocelot switch lib 2021-10-12 17:35:18 -07:00
sound ALSA: pcm: Fix potential AB/BA lock with buffer_mutex and mmap_lock 2022-04-08 14:22:55 +02:00
target scsi: target: Fix ordered tag handling 2021-11-25 09:48:29 +01:00
trace rxrpc: Fix call timer start racing with call destruction 2022-04-08 14:24:10 +02:00
uapi bpf: Make remote_port field in struct bpf_sk_lookup 16-bit wide 2022-04-13 20:59:25 +02:00
vdso
video
xen xen/gnttab: fix gnttab_end_foreign_access() without page specified 2022-03-11 12:22:37 +01:00