Eric Dumazet
4fe5a00ec7
net: sched: fix TCF_LAYER_TRANSPORT handling in tcf_get_base_ptr()
syzbot reported that tcf_get_base_ptr() can be called while transport
header is not set [1].
Instead of returning a dangling pointer, return NULL.
Fix tcf_get_base_ptr() callers to handle this NULL value.
[1]
WARNING: CPU: 1 PID: 6019 at ./include/linux/skbuff.h:3071 skb_transport_header include/linux/skbuff.h:3071 [inline]
WARNING: CPU: 1 PID: 6019 at ./include/linux/skbuff.h:3071 tcf_get_base_ptr include/net/pkt_cls.h:539 [inline]
WARNING: CPU: 1 PID: 6019 at ./include/linux/skbuff.h:3071 em_nbyte_match+0x2d8/0x3f0 net/sched/em_nbyte.c:43
Modules linked in:
CPU: 1 UID: 0 PID: 6019 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full)
Call Trace:
<TASK>
tcf_em_match net/sched/ematch.c:494 [inline]
__tcf_em_tree_match+0x1ac/0x770 net/sched/ematch.c:520
tcf_em_tree_match include/net/pkt_cls.h:512 [inline]
basic_classify+0x115/0x2d0 net/sched/cls_basic.c:50
tc_classify include/net/tc_wrapper.h:197 [inline]
__tcf_classify net/sched/cls_api.c:1764 [inline]
tcf_classify+0x4cf/0x1140 net/sched/cls_api.c:1860
multiq_classify net/sched/sch_multiq.c:39 [inline]
multiq_enqueue+0xfd/0x4c0 net/sched/sch_multiq.c:66
dev_qdisc_enqueue+0x4e/0x260 net/core/dev.c:4118
__dev_xmit_skb net/core/dev.c:4214 [inline]
__dev_queue_xmit+0xe83/0x3b50 net/core/dev.c:4729
packet_snd net/packet/af_packet.c:3076 [inline]
packet_sendmsg+0x3e33/0x5080 net/packet/af_packet.c:3108
sock_sendmsg_nosec net/socket.c:727 [inline]
__sock_sendmsg+0x21c/0x270 net/socket.c:742
____sys_sendmsg+0x505/0x830 net/socket.c:2630
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: syzbot+f3a497f02c389d86ef16@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/6920855a.a70a0220.2ea503.0058.GAE@google.com/T/#u
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://patch.msgid.link/20251121154100.1616228-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-11-24 18:53:14 -08:00
..
2025-11-20 17:01:09 -05:00
2024-12-09 14:44:59 -08:00
2025-10-29 20:04:55 -07:00
2025-08-19 14:42:44 +02:00
2025-09-11 17:40:13 -07:00
2025-09-18 08:47:52 +02:00
2025-09-03 17:02:12 -07:00
2025-09-04 10:19:17 +02:00
2025-10-03 10:23:50 -07:00
2025-08-19 19:36:26 -07:00
2025-08-28 16:46:23 -07:00
2025-09-02 15:52:24 -07:00
2025-01-20 12:16:04 -08:00
2025-04-24 17:03:45 -07:00
2025-07-08 18:05:25 -07:00
2025-07-07 16:55:54 -07:00
2025-07-02 14:22:02 -07:00
2025-03-24 10:26:53 +00:00
2025-09-09 10:56:02 +02:00
2025-09-09 10:56:02 +02:00
2025-10-01 10:14:49 +02:00
2025-02-27 14:03:14 +01:00
2025-10-28 14:56:30 +01:00
2025-05-30 19:53:51 -07:00
2025-09-14 11:55:04 -07:00
2025-09-17 18:30:51 -07:00
2025-09-18 12:32:06 +02:00
2025-02-11 11:58:17 +01:00
2025-06-17 17:52:01 -07:00
2025-09-14 14:28:12 -07:00
2025-08-29 19:36:31 -07:00
2025-04-15 17:54:56 -07:00
2025-08-26 17:34:31 -07:00
2025-09-03 15:16:49 -07:00
2025-09-25 12:42:49 +02:00
2025-09-30 15:45:53 +02:00
2025-09-11 12:22:38 +02:00
2025-03-24 12:10:13 -07:00
2025-09-22 11:38:43 -07:00
2025-09-23 10:12:15 +02:00
2025-08-26 17:34:31 -07:00
2025-03-18 13:18:36 +01:00
2025-09-23 10:12:15 +02:00
2025-01-06 13:49:38 -08:00
2025-09-23 10:12:15 +02:00
2024-12-17 19:37:00 -08:00
2025-04-24 09:29:56 +02:00
2025-09-18 10:17:09 +02:00
2025-07-02 14:32:30 -07:00
2025-08-26 17:34:31 -07:00
2025-10-13 17:43:46 -07:00
2025-08-13 08:34:33 +02:00
2025-09-08 18:06:21 -07:00
2025-03-21 17:36:49 +08:00
2025-03-18 13:18:36 +01:00
2025-03-25 07:31:24 -07:00
2025-08-13 18:18:33 -07:00
2025-04-15 17:54:56 -07:00
2024-12-06 17:43:08 -08:00
2025-07-02 14:32:30 -07:00
2025-09-19 11:26:23 +02:00
2025-01-20 12:20:42 +00:00
2025-07-15 12:08:39 +02:00
2025-04-15 08:21:46 -07:00
2025-07-10 15:27:32 -07:00
2025-07-17 16:25:22 -07:00
2025-09-29 11:20:29 -07:00
2025-05-22 09:42:41 -07:00
2025-03-12 13:32:35 -07:00
2025-09-04 10:19:17 +02:00
2025-04-09 17:01:51 -07:00
2025-07-02 15:39:04 -07:00
2025-07-23 17:46:54 -07:00
2025-04-24 09:29:56 +02:00
2025-06-13 18:17:08 -07:00
2025-09-01 13:15:14 -07:00
2025-11-24 18:53:14 -08:00
2025-07-10 11:08:35 +02:00
2025-08-19 19:20:59 -07:00
2025-09-18 12:32:06 +02:00
2025-09-14 11:35:17 -07:00
2025-09-22 17:55:25 -07:00
2025-08-27 07:43:08 -07:00
2025-08-29 19:36:32 -07:00
2025-09-03 15:08:20 -07:00
2025-04-11 18:58:10 -07:00
2025-02-21 15:28:03 -08:00
2025-08-14 17:52:29 -07:00
2025-07-04 09:32:35 +02:00
2025-04-11 18:58:10 -07:00
2025-08-26 18:11:29 -07:00
2025-09-23 11:13:22 +02:00
2025-09-08 18:06:21 -07:00
2025-09-29 18:30:32 -07:00
2025-05-05 16:48:12 -07:00
2025-09-11 19:05:56 -07:00
2025-09-18 08:47:52 +02:00
2025-10-29 17:30:19 -07:00
2025-07-11 11:00:57 -07:00
2025-08-25 17:53:35 -07:00
2025-10-29 18:32:18 -07:00
2025-06-24 16:31:36 -07:00
2025-09-23 16:38:39 -07:00
2025-06-17 18:18:46 -07:00
2025-07-14 17:19:13 -07:00
2025-09-23 13:35:12 -07:00
2025-07-10 14:48:29 +02:00
2025-09-24 10:22:37 -07:00
2025-10-30 11:52:31 +01:00
2025-04-24 17:11:52 -07:00