linux/include
Zijian Zhang 6781cfa93a bpf: Add sk_is_inet and IS_ICSK check in tls_sw_has_ctx_tx/rx
[ Upstream commit 44d0469f79 ]

As the introduction of the support for vsock and unix sockets in sockmap,
tls_sw_has_ctx_tx/rx cannot presume the socket passed in must be IS_ICSK.
vsock and af_unix sockets have vsock_sock and unix_sock instead of
inet_connection_sock. For these sockets, tls_get_ctx may return an invalid
pointer and cause page fault in function tls_sw_ctx_rx.

BUG: unable to handle page fault for address: 0000000000040030
Workqueue: vsock-loopback vsock_loopback_work
RIP: 0010:sk_psock_strp_data_ready+0x23/0x60
Call Trace:
 ? __die+0x81/0xc3
 ? no_context+0x194/0x350
 ? do_page_fault+0x30/0x110
 ? async_page_fault+0x3e/0x50
 ? sk_psock_strp_data_ready+0x23/0x60
 virtio_transport_recv_pkt+0x750/0x800
 ? update_load_avg+0x7e/0x620
 vsock_loopback_work+0xd0/0x100
 process_one_work+0x1a7/0x360
 worker_thread+0x30/0x390
 ? create_worker+0x1a0/0x1a0
 kthread+0x112/0x130
 ? __kthread_cancel_work+0x40/0x40
 ret_from_fork+0x1f/0x40

v2:
  - Add IS_ICSK check
v3:
  - Update the commits in Fixes

Fixes: 634f1a7110 ("vsock: support sockmap")
Fixes: 94531cfcbe ("af_unix: Add unix_stream_proto for sockmap")
Signed-off-by: Zijian Zhang <zijianzhang@bytedance.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Cong Wang <cong.wang@bytedance.com>
Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20241106003742.399240-1-zijianzhang@bytedance.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-17 15:09:53 +01:00
..
acpi ACPI: CPPC: Make rmw_lock a raw_spin_lock 2024-11-08 16:30:49 +01:00
asm-generic runtime constants: deal with old decrepit linkers 2024-08-03 08:38:45 -07:00
clocksource
crypto crypto: simd - Do not call crypto_alloc_tfm during registration 2024-10-10 12:03:13 +02:00
drm drm/tests: helpers: Add helper for drm_display_mode_from_cea_vic() 2024-11-08 16:30:59 +01:00
dt-bindings dt-bindings: clock: qcom: Add GPLL9 support on gcc-sc8180x 2024-10-10 12:04:02 +02:00
keys
kunit kunit: Fix missing kerneldoc comment 2024-09-05 14:29:10 -06:00
kvm
linux block: rework bio splitting 2024-11-14 13:21:15 +01:00
math-emu
media
memory
misc
net bpf: Add sk_is_inet and IS_ICSK check in tls_sw_has_ctx_tx/rx 2024-11-17 15:09:53 +01:00
pcmcia
ras mm/memory-failure: remove obsolete MF_MSG_DIFFERENT_COMPOUND 2024-07-12 15:52:22 -07:00
rdma
rv
scsi scsi: core: Fix the return value of scsi_logical_block_count() 2024-08-16 21:02:06 -04:00
soc net: mscc: ocelot: treat 802.1ad tagged traffic as 802.1Q-untagged 2024-08-16 09:59:32 +01:00
sound ASoC: tas2781-i2c: Drop weird GPIO code 2024-10-04 16:37:38 +02:00
target
trace rxrpc: Fix missing locking causing hanging calls 2024-11-14 13:21:01 +01:00
uapi dpll: add Embedded SYNC feature for a pin 2024-11-08 16:30:47 +01:00
ufs scsi: ufs: core: Add a quirk for handling broken LSDBS field in controller capabilities register 2024-08-16 21:09:17 -04:00
vdso Random number generator updates for Linux 6.11-rc1. 2024-07-24 10:29:50 -07:00
video
xen Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00