syzbot


UBSAN: shift-out-of-bounds in nci_activate_target

Status: fixed on 2023/12/21 03:45
Subsystems: net nfc
[Documentation on labels]
Reported-by: syzbot+0839b78e119aae1fec78@syzkaller.appspotmail.com
Fix commit: 354a6e707e29 nfc: nci: assert requested protocol is valid
First crash: 340d, last: 152d
Cause bisection: introduced by (bisect log) :
commit e624e6c3e777fb3dfed036b9da4d433aee3608a5
Author: Bongsu Jeon <bongsu.jeon@samsung.com>
Date: Wed Jan 27 13:08:28 2021 +0000

  nfc: Add a virtual nci device driver

Crash: UBSAN: shift-out-of-bounds in nci_activate_target (log)
Repro: C syz .config
  
Discussions (6)
Title Replies (including bot) Last reply
[PATCH] nfc: nci: assert requested protocol is valid 7 (7) 2023/10/12 07:40
[syzbot] Monthly nfc report (Oct 2023) 0 (1) 2023/10/09 12:45
Re: [PATCH] nfc: nci: assert requested protocol is valid 1 (1) 2023/09/07 12:41
[syzbot] Monthly nfc report (Sep 2023) 0 (1) 2023/09/06 08:12
[syzbot] [nfc?] UBSAN: shift-out-of-bounds in nci_activate_target 0 (3) 2023/07/09 02:49
[PATCH] net: nfc: nci: fix for UBSAN: shift-out-of-bounds in nci_activate_target 4 (4) 2023/04/19 08:28
Last patch testing requests (3)
Created Duration User Patch Repo Result
2023/09/06 17:22 2h14m jeremy@jcline.org patch upstream OK log
2023/08/28 11:28 22m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci report log
2023/07/08 02:55 20m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a452483508d7 OK log
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2023/10/01 21:35 1h34m bisect fix upstream job log (0) log
2023/08/09 20:08 1h25m bisect fix upstream job log (0) log

Sample crash report:
================================================================================
UBSAN: shift-out-of-bounds in net/nfc/nci/core.c:912:45
shift exponent 268435489 is too large for 32-bit type 'int'
CPU: 0 PID: 5028 Comm: syz-executor696 Not tainted 6.4.0-syzkaller-12155-ga452483508d7 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x136/0x150 lib/dump_stack.c:106
 ubsan_epilogue lib/ubsan.c:217 [inline]
 __ubsan_handle_shift_out_of_bounds+0x221/0x5a0 lib/ubsan.c:387
 nci_activate_target.cold+0x1a/0x1f net/nfc/nci/core.c:912
 nfc_activate_target+0x1f8/0x4c0 net/nfc/core.c:420
 nfc_genl_activate_target+0x1f3/0x290 net/nfc/netlink.c:900
 genl_family_rcv_msg_doit.isra.0+0x1e6/0x2d0 net/netlink/genetlink.c:970
 genl_family_rcv_msg net/netlink/genetlink.c:1050 [inline]
 genl_rcv_msg+0x4ff/0x7e0 net/netlink/genetlink.c:1067
 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2549
 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1078
 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline]
 netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365
 netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1914
 sock_sendmsg_nosec net/socket.c:725 [inline]
 sock_sendmsg+0xde/0x190 net/socket.c:748
 ____sys_sendmsg+0x739/0x920 net/socket.c:2494
 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2548
 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2577
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7ff498fc3ab9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 71 16 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff49876f2e8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007ff4990542a0 RCX: 00007ff498fc3ab9
RDX: 0000000000000000 RSI: 0000000020000780 RDI: 0000000000000005
RBP: 00007ff49901a510 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005
R13: 0000000000000001 R14: 0000000000000000 R15: 00007ff4990542a8
 </TASK>
================================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/07/07 10:22 upstream a452483508d7 22ae5830 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root UBSAN: shift-out-of-bounds in nci_activate_target
2023/10/03 21:50 linux-next c9f2baaa18b5 65faba36 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root UBSAN: shift-out-of-bounds in nci_activate_target
2023/07/09 01:47 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci e40939bbfc68 668cb1fa .config console log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 UBSAN: shift-out-of-bounds in nci_activate_target
2023/07/07 07:20 upstream a452483508d7 22ae5830 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root UBSAN: shift-out-of-bounds in nci_activate_target
2023/04/19 08:26 upstream af67688dca57 94b4184e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root UBSAN: shift-out-of-bounds in nci_activate_target
2023/03/29 16:17 linux-next 198925fae644 f325deb0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root UBSAN: shift-out-of-bounds in nci_activate_target
* Struck through repros no longer work on HEAD.