Files
linux/include/uapi/linux
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
..
2021-09-14 08:46:08 +02:00
2021-01-25 18:44:44 +01:00
2020-05-28 11:22:14 +02:00
2021-08-17 11:47:53 -04:00
2020-12-28 14:21:31 +00:00
2019-12-18 18:07:31 +01:00
2021-02-09 10:58:19 +01:00
2021-06-10 20:59:05 -04:00
2020-08-12 10:58:00 -07:00
2019-03-07 18:32:01 -08:00
2020-10-09 12:47:02 -06:00
2021-03-04 17:58:15 -08:00
2021-08-23 13:19:09 +02:00
2021-08-23 13:19:09 +02:00
2019-10-09 22:31:14 -04:00
2019-09-25 17:51:39 -07:00
2019-08-02 14:44:02 +10:00
2021-08-10 13:32:40 -04:00
2020-07-19 19:20:22 -07:00
2020-06-24 21:34:11 +02:00
2020-05-14 16:44:25 +02:00
2019-03-27 13:30:07 -07:00
2021-02-08 13:01:24 +01:00
2021-10-06 12:05:51 +00:00
2021-06-03 15:31:34 -07:00
2020-07-13 15:32:56 -07:00
2020-04-20 12:43:24 -07:00
2021-02-26 09:41:03 -08:00
2021-05-21 15:03:50 +02:00
2020-05-21 08:20:35 -06:00
2021-03-10 09:34:06 +01:00
2020-08-18 15:44:44 +02:00
2021-07-06 10:37:46 -05:00
2019-10-02 20:32:27 -06:00
2019-01-22 10:21:45 +01:00
2019-07-30 20:34:34 +02:00
2022-04-08 14:23:00 +02:00
2020-03-29 22:30:57 -07:00
2021-01-16 23:19:26 +01:00
2021-03-10 09:34:06 +01:00
2021-06-23 12:56:08 -07:00
2019-12-18 18:07:31 +01:00
2021-01-07 16:17:32 +01:00
2019-12-09 09:59:07 +01:00
2020-03-29 23:29:08 +02:00
2020-10-23 11:55:28 -04:00
2020-10-23 11:55:28 -04:00
2019-08-01 21:49:46 +02:00
2021-06-12 13:16:45 -07:00
2020-07-13 15:32:56 -07:00