syzbot


KASAN: use-after-free Read in ip_tunnel_xmit

Status: upstream: reported C repro on 2021/03/02 14:45
Reported-by: syzbot+ecb6390f500765f46563@syzkaller.appspotmail.com
First crash: 1389d, last: 777d
Fix bisection the fix commit could be any of (bisect log):
  670d6552eda8 Linux 4.14.227
  e548869f356f Linux 4.14.291
  
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KMSAN: uninit-value in ip_tunnel_xmit (3) net C 1516 806d 1494d 0/28 closed as invalid on 2022/10/12 18:48
upstream KMSAN: uninit-value in ip_tunnel_xmit (4) net C 21 397d 474d 0/28 auto-obsoleted due to no activity on 2024/01/12 09:25
Fix bisection attempts (17)
Created Duration User Patch Repo Result
2022/08/30 01:01 25m bisect fix linux-4.14.y OK (2) job log
2022/07/28 08:12 21m bisect fix linux-4.14.y OK (0) job log log
2022/06/28 07:37 20m bisect fix linux-4.14.y OK (0) job log log
2022/05/28 19:18 26m bisect fix linux-4.14.y OK (0) job log log
2022/04/28 18:55 22m bisect fix linux-4.14.y OK (0) job log log
2022/03/29 18:18 24m bisect fix linux-4.14.y OK (0) job log log
2022/02/25 23:26 24m bisect fix linux-4.14.y OK (0) job log log
2022/01/26 22:49 22m bisect fix linux-4.14.y OK (0) job log log
2021/12/27 22:22 27m bisect fix linux-4.14.y OK (0) job log log
2021/11/27 21:57 25m bisect fix linux-4.14.y OK (0) job log log
2021/10/28 21:30 22m bisect fix linux-4.14.y OK (0) job log log
2021/09/25 15:21 22m bisect fix linux-4.14.y OK (0) job log log
2021/08/26 14:43 24m bisect fix linux-4.14.y OK (0) job log log
2021/07/27 13:46 27m bisect fix linux-4.14.y OK (0) job log log
2021/06/27 13:16 28m bisect fix linux-4.14.y OK (0) job log log
2021/05/28 12:44 26m bisect fix linux-4.14.y OK (0) job log log
2021/04/28 12:11 26m bisect fix linux-4.14.y OK (0) job log log

Sample crash report:
IPv6: ADDRCONF(NETDEV_CHANGE): macvtap0: link becomes ready
batman_adv: batadv0: Interface activated: batadv_slave_1
IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
==================================================================
BUG: KASAN: use-after-free in ip_tunnel_xmit+0x24b4/0x33e0 net/ipv4/ip_tunnel.c:659
Read of size 4 at addr ffff8880abbbd8b0 by task syz-executor339/7977

CPU: 0 PID: 7977 Comm: syz-executor339 Not tainted 4.14.298-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load4_noabort+0x68/0x70 mm/kasan/report.c:429
 ip_tunnel_xmit+0x24b4/0x33e0 net/ipv4/ip_tunnel.c:659
 ipgre_xmit+0x412/0x780 net/ipv4/ip_gre.c:670
 __netdev_start_xmit include/linux/netdevice.h:4054 [inline]
 netdev_start_xmit include/linux/netdevice.h:4063 [inline]
 xmit_one net/core/dev.c:3005 [inline]
 dev_hard_start_xmit+0x188/0x890 net/core/dev.c:3021
 __dev_queue_xmit+0x1d7f/0x2480 net/core/dev.c:3521
 packet_snd+0x13aa/0x26f0 net/packet/af_packet.c:3032
 packet_sendmsg+0x12ed/0x33a0 net/packet/af_packet.c:3061
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062
 __sys_sendmsg+0xa3/0x120 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2103
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x5e/0xd3

Allocated by task 7977:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 __do_kmalloc_node mm/slab.c:3682 [inline]
 __kmalloc_node_track_caller+0x4c/0x70 mm/slab.c:3696
 __kmalloc_reserve net/core/skbuff.c:137 [inline]
 __alloc_skb+0x96/0x510 net/core/skbuff.c:205
 alloc_skb include/linux/skbuff.h:980 [inline]
 alloc_skb_with_frags+0x85/0x500 net/core/skbuff.c:5259
 sock_alloc_send_pskb+0x577/0x6d0 net/core/sock.c:2101
 packet_alloc_skb net/packet/af_packet.c:2882 [inline]
 packet_snd+0x4f7/0x26f0 net/packet/af_packet.c:2977
 packet_sendmsg+0x12ed/0x33a0 net/packet/af_packet.c:3061
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062
 __sys_sendmsg+0xa3/0x120 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2103
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x5e/0xd3

Freed by task 7977:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 skb_free_head net/core/skbuff.c:563 [inline]
 pskb_expand_head+0x895/0xd30 net/core/skbuff.c:1505
 __pskb_pull_tail+0xd9/0x14a0 net/core/skbuff.c:1908
 pskb_may_pull include/linux/skbuff.h:2181 [inline]
 ip_tunnel_xmit+0x1405/0x33e0 net/ipv4/ip_tunnel.c:651
 ipgre_xmit+0x412/0x780 net/ipv4/ip_gre.c:670
 __netdev_start_xmit include/linux/netdevice.h:4054 [inline]
 netdev_start_xmit include/linux/netdevice.h:4063 [inline]
 xmit_one net/core/dev.c:3005 [inline]
 dev_hard_start_xmit+0x188/0x890 net/core/dev.c:3021
 __dev_queue_xmit+0x1d7f/0x2480 net/core/dev.c:3521
 packet_snd+0x13aa/0x26f0 net/packet/af_packet.c:3032
 packet_sendmsg+0x12ed/0x33a0 net/packet/af_packet.c:3061
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062
 __sys_sendmsg+0xa3/0x120 net/socket.c:2096
 SYSC_sendmsg net/socket.c:2107 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2103
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x5e/0xd3

The buggy address belongs to the object at ffff8880abbbd800
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 176 bytes inside of
 512-byte region [ffff8880abbbd800, ffff8880abbbda00)
The buggy address belongs to the page:
page:ffffea0002aeef40 count:1 mapcount:0 mapping:ffff8880abbbd080 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880abbbd080 0000000000000000 0000000100000006
raw: ffffea0002b1d320 ffffea0002ab6260 ffff88813fe74940 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880abbbd780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880abbbd800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880abbbd880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
 ffff8880abbbd900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880abbbd980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/11/05 09:29 linux-4.14.y a901bb6c7db7 6d752409 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in ip_tunnel_xmit
2021/03/29 11:14 linux-4.14.y 670d6552eda8 a8529b82 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in ip_tunnel_xmit
2021/03/02 15:04 linux-4.14.y 3242aa3a635c 92ead296 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in ip_tunnel_xmit
2022/11/05 09:13 linux-4.14.y a901bb6c7db7 6d752409 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in ip_tunnel_xmit
2021/03/02 14:44 linux-4.14.y 3242aa3a635c 92ead296 .config console log report info ci2-linux-4-14 KASAN: use-after-free Read in ip_tunnel_xmit
* Struck through repros no longer work on HEAD.