linux/include
Jason Baron f19008e676 tcp: correct read of TFO keys on big endian systems
When TFO keys are read back on big endian systems either via the global
sysctl interface or via getsockopt() using TCP_FASTOPEN_KEY, the values
don't match what was written.

For example, on s390x:

# echo "1-2-3-4" > /proc/sys/net/ipv4/tcp_fastopen_key
# cat /proc/sys/net/ipv4/tcp_fastopen_key
02000000-01000000-04000000-03000000

Instead of:

# cat /proc/sys/net/ipv4/tcp_fastopen_key
00000001-00000002-00000003-00000004

Fix this by converting to the correct endianness on read. This was
reported by Colin Ian King when running the 'tcp_fastopen_backup_key' net
selftest on s390x, which depends on the read value matching what was
written. I've confirmed that the test now passes on big and little endian
systems.

Signed-off-by: Jason Baron <jbaron@akamai.com>
Fixes: 438ac88009 ("net: fastopen: robustness and endianness fixes for SipHash")
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Eric Dumazet <edumazet@google.com>
Reported-and-tested-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-10 12:12:35 -07:00
..
acpi ACPI updates for 5.9-rc1 2020-08-03 20:37:22 -07:00
asm-generic Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-08-05 20:13:21 -07:00
clocksource
crypto It's been a busy cycle for documentation - hopefully the busiest for a 2020-08-04 22:47:54 -07:00
drm drm next for 5.9-rc1 2020-08-05 19:50:06 -07:00
dt-bindings drm next for 5.9-rc1 2020-08-05 19:50:06 -07:00
keys It's been a busy cycle for documentation - hopefully the busiest for a 2020-08-04 22:47:54 -07:00
kunit
kvm
linux net: Revert "net: optimize the sockptr_t for unified kernel/user address spaces" 2020-08-10 12:06:44 -07:00
math-emu
media
memory memory: add Renesas RPC-IF driver 2020-07-01 22:45:14 +01:00
misc
net tcp: correct read of TFO keys on big endian systems 2020-08-10 12:12:35 -07:00
pcmcia
ras
rdma IB/rdmavt: Fix RQ counting issues causing use of an invalid RWQE 2020-07-29 15:54:36 -03:00
scsi
soc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-08-05 20:13:21 -07:00
sound ASoC: Fixes for v5.8 2020-07-17 18:19:02 +02:00
target
trace Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-08-05 20:13:21 -07:00
uapi bpf: Change uapi for bpf iterator map elements 2020-08-06 16:39:14 -07:00
vdso arm64/vdso: Add time namespace page 2020-07-24 13:15:20 +01:00
video
xen xen: netif.h: add a new extra type for XDP 2020-07-01 15:25:14 -07:00