Jibin Zhang
f920436a44
net: use sock_gen_put() when sk_state is TCP_TIME_WAIT
It is possible for a pointer of type struct inet_timewait_sock to be
returned from the functions __inet_lookup_established() and
__inet6_lookup_established(). This can cause a crash when the
returned pointer is of type struct inet_timewait_sock and
sock_put() is called on it. The following is a crash call stack that
shows sk->sk_wmem_alloc being accessed in sk_free() during the call to
sock_put() on a struct inet_timewait_sock pointer. To avoid this issue,
use sock_gen_put() instead of sock_put() when sk->sk_state
is TCP_TIME_WAIT.
mrdump.ko ipanic() + 120
vmlinux notifier_call_chain(nr_to_call=-1, nr_calls=0) + 132
vmlinux atomic_notifier_call_chain(val=0) + 56
vmlinux panic() + 344
vmlinux add_taint() + 164
vmlinux end_report() + 136
vmlinux kasan_report(size=0) + 236
vmlinux report_tag_fault() + 16
vmlinux do_tag_recovery() + 16
vmlinux __do_kernel_fault() + 88
vmlinux do_bad_area() + 28
vmlinux do_tag_check_fault() + 60
vmlinux do_mem_abort() + 80
vmlinux el1_abort() + 56
vmlinux el1h_64_sync_handler() + 124
vmlinux > 0xFFFFFFC080011294()
vmlinux __lse_atomic_fetch_add_release(v=0xF2FFFF82A896087C)
vmlinux __lse_atomic_fetch_sub_release(v=0xF2FFFF82A896087C)
vmlinux arch_atomic_fetch_sub_release(i=1, v=0xF2FFFF82A896087C)
+ 8
vmlinux raw_atomic_fetch_sub_release(i=1, v=0xF2FFFF82A896087C)
+ 8
vmlinux atomic_fetch_sub_release(i=1, v=0xF2FFFF82A896087C) + 8
vmlinux __refcount_sub_and_test(i=1, r=0xF2FFFF82A896087C,
oldp=0) + 8
vmlinux __refcount_dec_and_test(r=0xF2FFFF82A896087C, oldp=0) + 8
vmlinux refcount_dec_and_test(r=0xF2FFFF82A896087C) + 8
vmlinux sk_free(sk=0xF2FFFF82A8960700) + 28
vmlinux sock_put() + 48
vmlinux tcp6_check_fraglist_gro() + 236
vmlinux tcp6_gro_receive() + 624
vmlinux ipv6_gro_receive() + 912
vmlinux dev_gro_receive() + 1116
vmlinux napi_gro_receive() + 196
ccmni.ko ccmni_rx_callback() + 208
ccmni.ko ccmni_queue_recv_skb() + 388
ccci_dpmaif.ko dpmaif_rxq_push_thread() + 1088
vmlinux kthread() + 268
vmlinux 0xFFFFFFC08001F30C()
Fixes: c9d1d23e52 ("net: add heuristic for enabling TCP fraglist GRO")
Signed-off-by: Jibin Zhang <jibin.zhang@mediatek.com>
Signed-off-by: Shiming Cheng <shiming.cheng@mediatek.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20250429020412.14163-1-shiming.cheng@mediatek.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-05-01 07:00:19 -07:00
..
2025-03-21 10:12:15 +01:00
2025-02-19 19:05:28 -08:00
2025-02-20 10:37:30 -08:00
2025-03-17 13:56:38 +00:00
2024-10-02 17:23:23 -04:00
2024-12-20 13:50:09 -08:00
2025-04-03 15:32:08 -07:00
2024-10-29 11:56:18 +01:00
2025-01-27 15:15:12 -08:00
2025-03-05 19:16:56 -08:00
2024-10-11 15:35:05 -07:00
2025-02-21 16:08:47 -08:00
2025-03-03 15:04:10 -08:00
2025-03-03 15:04:11 -08:00
2024-09-09 17:21:47 -07:00
2024-10-22 15:33:24 +02:00
2025-02-28 14:41:33 -08:00
2025-02-11 11:26:53 +01:00
2025-04-05 10:30:12 +02:00
2025-03-24 12:10:13 -07:00
2025-03-25 10:34:33 -07:00
2025-04-05 10:30:12 +02:00
2025-03-06 15:26:02 -08:00
2025-03-04 17:46:26 -08:00
2025-02-14 13:09:39 -08:00
2025-03-18 13:18:36 +01:00
2025-02-21 15:28:02 -08:00
2025-01-02 17:17:40 -08:00
2024-11-12 11:24:51 +01:00
2025-03-17 13:56:17 +00:00
2025-01-22 08:28:57 -08:00
2025-04-03 15:47:35 -07:00
2025-03-08 09:06:50 -08:00
2025-02-21 15:28:02 -08:00
2025-02-21 15:28:02 -08:00
2025-01-23 07:08:13 -08:00
2025-04-05 10:30:12 +02:00
2024-07-30 18:35:12 -07:00
2024-06-05 10:06:00 +01:00
2024-11-15 11:00:29 +01:00
2025-03-25 07:32:00 -07:00
2025-02-28 14:41:33 -08:00
2025-02-26 18:11:17 -08:00
2025-02-18 18:27:19 -08:00
2025-02-06 16:14:14 -08:00
2025-02-26 18:11:17 -08:00
2025-02-11 13:08:00 +01:00
2024-11-03 12:10:11 -08:00
2024-05-02 16:26:56 -07:00
2025-01-29 13:32:23 -08:00
2024-10-31 18:22:48 -07:00
2025-01-20 12:26:41 +00:00
2025-03-17 13:54:11 +00:00
2025-03-17 13:56:38 +00:00
2025-03-07 19:39:53 -08:00
2025-03-31 16:53:54 -07:00
2024-08-06 12:16:25 -07:00
2025-03-31 16:53:54 -07:00
2025-03-25 10:34:33 -07:00
2025-03-03 15:44:19 -08:00
2025-03-17 13:56:17 +00:00
2025-05-01 07:00:19 -07:00
2025-03-25 10:34:33 -07:00
2024-06-24 16:41:22 -07:00
2025-03-26 21:48:21 -07:00
2025-03-31 16:53:54 -07:00
2025-04-29 14:46:28 -07:00
2025-03-25 09:15:07 -07:00
2025-04-02 17:18:27 -07:00
2024-10-03 16:21:21 -07:00
2024-11-06 12:42:51 +01:00
2024-10-03 16:21:21 -07:00