syzbot


KASAN: use-after-free Read in sock_has_perm

Status: auto-closed as invalid on 2020/04/28 08:59
Reported-by: syzbot+a80aa75efd05481e7acd@syzkaller.appspotmail.com
First crash: 1577d, last: 1577d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in sock_has_perm selinux 1 622d 617d 0/26 auto-obsoleted due to no activity on 2022/12/09 14:55
android-44 KASAN: use-after-free Read in sock_has_perm 1 2218d 2218d 0/2 auto-closed as invalid on 2019/02/22 15:19

Sample crash report:
device team0 entered promiscuous mode
device team_slave_0 entered promiscuous mode
device team_slave_1 entered promiscuous mode
8021q: adding VLAN 0 to HW filter on device team0
==================================================================
BUG: KASAN: use-after-free in sock_has_perm+0x258/0x280 security/selinux/hooks.c:4362
Read of size 8 at addr ffff888084d3fb30 by task syz-executor.1/13522

CPU: 0 PID: 13522 Comm: syz-executor.1 Not tainted 4.14.160-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x142/0x197 lib/dump_stack.c:58
 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
 sock_has_perm+0x258/0x280 security/selinux/hooks.c:4362
 selinux_socket_sendmsg+0x36/0x40 security/selinux/hooks.c:4628
 security_socket_sendmsg+0x7d/0xb0 security/security.c:1378
 sock_sendmsg+0x47/0x110 net/socket.c:653
 ___sys_sendmsg+0x349/0x840 net/socket.c:2062
 __sys_sendmmsg+0x152/0x3a0 net/socket.c:2152
 SYSC_sendmmsg net/socket.c:2183 [inline]
 SyS_sendmmsg+0x35/0x60 net/socket.c:2178
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x45a919
RSP: 002b:00007f6b8194ac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 000000000045a919
RDX: 0800000000000059 RSI: 0000000020005fc0 RDI: 0000000000000005
RBP: 000000000075c118 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000800f401 R11: 0000000000000246 R12: 00007f6b8194b6d4
R13: 00000000004c9267 R14: 00000000004e0fa0 R15: 00000000ffffffff

Allocated by task 13498:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
 __do_kmalloc mm/slab.c:3720 [inline]
 __kmalloc+0x15d/0x7a0 mm/slab.c:3729
 kmalloc include/linux/slab.h:493 [inline]
 sk_prot_alloc+0x171/0x2a0 net/core/sock.c:1467
 sk_alloc+0x39/0xd70 net/core/sock.c:1521
 pppol2tp_create+0x32/0x1f0 net/l2tp/l2tp_ppp.c:534
 pppox_create+0xf7/0x210 drivers/net/ppp/pppox.c:134
 __sock_create+0x2f6/0x620 net/socket.c:1275
 sock_create net/socket.c:1315 [inline]
 SYSC_socket net/socket.c:1345 [inline]
 SyS_socket+0xd3/0x170 net/socket.c:1325
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 13522:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xcc/0x270 mm/slab.c:3815
 sk_prot_free net/core/sock.c:1504 [inline]
 __sk_destruct+0x50f/0x650 net/core/sock.c:1581
 sk_destruct+0xa4/0xd0 net/core/sock.c:1596
 __sk_free+0x54/0x230 net/core/sock.c:1604
 sk_free+0x35/0x40 net/core/sock.c:1615
 sock_put include/net/sock.h:1653 [inline]
 pppol2tp_sendmsg+0x5b0/0x810 net/l2tp/l2tp_ppp.c:350
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xce/0x110 net/socket.c:656
 ___sys_sendmsg+0x349/0x840 net/socket.c:2062
 __sys_sendmmsg+0x152/0x3a0 net/socket.c:2152
 SYSC_sendmmsg net/socket.c:2183 [inline]
 SyS_sendmmsg+0x35/0x60 net/socket.c:2178
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff888084d3f740
 which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 1008 bytes inside of
 2048-byte region [ffff888084d3f740, ffff888084d3ff40)
The buggy address belongs to the page:
page:ffffea0002134f80 count:1 mapcount:0 mapping:ffff888084d3e640 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffff888084d3e640 0000000000000000 0000000100000003
raw: ffffea00027ea120 ffff8880aa801948 ffff8880aa800c40 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888084d3fa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888084d3fa80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888084d3fb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
 ffff888084d3fb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888084d3fc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
net_ratelimit: 20 callbacks suppressed
protocol 88fb is buggy, dev hsr_slave_0
protocol 88fb is buggy, dev hsr_slave_1
protocol 88fb is buggy, dev hsr_slave_1

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/12/30 08:58 linux-4.14.y e1f7d50ae3a3 af6b8ef8 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.