syzbot


WARNING in __dma_map_sg_attrs

Status: upstream: reported C repro on 2021/12/01 18:18
Reported-by: syzbot+10e27961f4da37c443b2@syzkaller.appspotmail.com
Fix commit: udmabuf: Set the DMA mask for the udmabuf device (v2)
Patched on: [ci-upstream-linux-next-kasan-gce-root], missing on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-leak ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce ci-upstream-kmsan-gce-386 ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 220d, last: 4d10h

Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: WARNING in dma_map_sg_attrs (log)
Repro: C syz .config

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 1 PID: 3603 at kernel/dma/mapping.c:188 __dma_map_sg_attrs+0x181/0x1f0 kernel/dma/mapping.c:188
Modules linked in:
CPU: 1 PID: 3603 Comm: syz-executor291 Not tainted 5.18.0-syzkaller-04943-g7e062cda7d90 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__dma_map_sg_attrs+0x181/0x1f0 kernel/dma/mapping.c:188
Code: 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 75 71 4c 8b 3d 50 66 c1 0d e9 db fe ff ff e8 e6 57 13 00 0f 0b e8 df 57 13 00 <0f> 0b 45 31 e4 e9 54 ff ff ff e8 d0 57 13 00 49 8d 7f 50 48 b8 00
RSP: 0018:ffffc90002effd68 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff8880236f5880 RSI: ffffffff81665c81 RDI: ffff88801ca89408
RBP: ffff88801ca89000 R08: 0000000000000002 R09: ffff88801f07dd4f
R10: ffffffff81665b62 R11: 0000000000000001 R12: 0000000000000001
R13: ffff88801ea0e100 R14: 0000000000000002 R15: 0000000000000000
FS:  0000555557506300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000005d84c8 CR3: 0000000071da1000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 dma_map_sgtable+0x70/0xf0 kernel/dma/mapping.c:264
 get_sg_table.isra.0+0xe0/0x160 drivers/dma-buf/udmabuf.c:72
 begin_cpu_udmabuf+0x130/0x1d0 drivers/dma-buf/udmabuf.c:126
 dma_buf_begin_cpu_access+0xfd/0x1d0 drivers/dma-buf/dma-buf.c:1172
 dma_buf_ioctl+0x259/0x2b0 drivers/dma-buf/dma-buf.c:363
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x46/0xb0
RIP: 0033:0x7f0c7cfafc19
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffdaf93778 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f0c7cfafc19
RDX: 0000000020000100 RSI: 0000000040086200 RDI: 0000000000000006
RBP: 00007f0c7cf73dc0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0c7cf73e50
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Fix bisection attempts:
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce 2022/05/09 23:25 upstream 9be9ed2612b5 a7dab638 .config log report syz C
Crashes (50):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce 2022/05/26 15:01 upstream 7e062cda7d90 3037caa9 .config log report syz C WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce 2022/05/26 14:15 upstream 7e062cda7d90 3037caa9 .config log report syz C WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce 2022/05/26 13:54 upstream 7e062cda7d90 3037caa9 .config log report syz C WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce 2022/05/26 13:34 upstream 7e062cda7d90 3037caa9 .config log report syz C WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce 2022/05/26 13:14 upstream 7e062cda7d90 3037caa9 .config log report syz C WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce 2022/05/26 12:45 upstream 7e062cda7d90 3037caa9 .config log report syz C WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce 2022/02/05 21:31 upstream 0457e5153e0e a7dab638 .config log report syz C WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-selinux-root 2022/02/05 20:17 upstream 0457e5153e0e a7dab638 .config log report syz C WARNING in __dma_map_sg_attrs
ci-upstream-linux-next-kasan-gce-root 2022/05/26 12:54 linux-next b1d84fc09a96 3037caa9 .config log report syz C WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce 2022/07/01 22:36 upstream a175eca0f3d7 1434eec0 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-selinux-root 2022/06/19 20:39 upstream 05c6ca8512f2 8f633d84 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce 2022/06/17 20:56 upstream f0ec9c65a8d6 cb58b3b2 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-root 2022/06/07 14:21 upstream e71e60cd74df c8857892 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce 2022/06/06 17:57 upstream f2906aa86338 c8857892 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-selinux-root 2022/06/06 17:31 upstream f2906aa86338 c8857892 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-root 2022/05/26 13:30 upstream 7e062cda7d90 3037caa9 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-selinux-root 2022/05/26 12:36 upstream 7e062cda7d90 3037caa9 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce 2022/05/26 12:29 upstream 7e062cda7d90 3037caa9 .config log report info WARNING in __dma_map_sg_attrs
ci-qemu-upstream 2022/05/26 12:28 upstream d7227785e384 3037caa9 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce 2022/05/15 19:12 upstream bc403203d65a 744a39e2 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-selinux-root 2022/05/14 18:19 upstream ec7f49619d8e 744a39e2 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce 2022/05/14 18:18 upstream ec7f49619d8e 744a39e2 .config log report info WARNING in __dma_map_sg_attrs
ci-qemu-upstream 2022/05/14 18:11 upstream ec7f49619d8e 744a39e2 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce 2022/05/13 06:58 upstream 0ac824f379fb 9ad6612a .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-selinux-root 2022/05/11 23:06 upstream feb9c5e19e91 beb0b407 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce 2022/04/07 03:38 upstream 3e732ebf7316 97582466 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-selinux-root 2022/03/13 05:40 upstream aad611a868d1 9e8eaa75 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce 2022/03/12 03:14 upstream 79b00034e9dc 9e8eaa75 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-selinux-root 2022/03/06 19:00 upstream dcde98da9970 7bdd8b2c .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-selinux-root 2022/02/05 19:59 upstream 0457e5153e0e a7dab638 .config log report info WARNING in __dma_map_sg_attrs
ci-qemu-upstream 2022/01/18 04:53 upstream 0c947b893d69 731a2d23 .config log report info WARNING in __dma_map_sg_attrs
ci-qemu-upstream 2022/01/10 11:49 upstream df0cc57e057f 2ca0d385 .config log report info WARNING in __dma_map_sg_attrs
ci-qemu-upstream 2021/11/27 18:13 upstream c5c17547b778 63eeac02 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-386 2022/06/07 20:57 upstream e71e60cd74df c8857892 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-386 2022/06/06 22:27 upstream f2906aa86338 c8857892 .config log report info WARNING in __dma_map_sg_attrs
ci-qemu-upstream-386 2022/05/26 12:35 upstream d7227785e384 3037caa9 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-386 2022/05/26 12:29 upstream 7e062cda7d90 3037caa9 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-386 2022/05/14 18:21 upstream ec7f49619d8e 744a39e2 .config log report info WARNING in __dma_map_sg_attrs
ci-qemu-upstream-386 2022/05/14 18:13 upstream ec7f49619d8e 744a39e2 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-kasan-gce-386 2022/02/05 20:11 upstream 0457e5153e0e a7dab638 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-linux-next-kasan-gce-root 2022/06/07 14:54 linux-next 73d0e32571a0 c8857892 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-linux-next-kasan-gce-root 2022/06/06 17:57 linux-next 40b58e42584b c8857892 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-linux-next-kasan-gce-root 2022/05/26 12:38 linux-next b1d84fc09a96 3037caa9 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-linux-next-kasan-gce-root 2022/05/14 18:21 linux-next 1e1b28b936ae 744a39e2 .config log report info WARNING in __dma_map_sg_attrs
ci-upstream-linux-next-kasan-gce-root 2022/03/19 20:02 linux-next 91265a6da44d e2d91b1d .config log report info WARNING in __dma_map_sg_attrs