* [syzbot] [mm?] kernel BUG in __page_table_check_zero
@ 2023-05-21 16:20 syzbot
2023-11-10 15:22 ` [syzbot] Discardable change syzbot
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: syzbot @ 2023-05-21 16:20 UTC (permalink / raw)
To: akpm, linux-kernel, linux-mm, pasha.tatashin, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 1b66c114d161 Merge tag 'nfsd-6.4-1' of git://git.kernel.or..
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=10ef2e5a280000
kernel config: https://syzkaller.appspot.com/x/.config?x=ac0db1213414a978
dashboard link: https://syzkaller.appspot.com/bug?extid=7a9bbb158a7a1071eb27
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=136b9e86280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11a85bd6280000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ac769e66fb5a/disk-1b66c114.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/bee287306a14/vmlinux-1b66c114.xz
kernel image: https://storage.googleapis.com/syzbot-assets/342e345ae447/bzImage-1b66c114.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+7a9bbb158a7a1071eb27@syzkaller.appspotmail.com
RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007fec20228c89
RDX: 0000000001000002 RSI: 0000000000400000 RDI: 0000000020000000
RBP: 00007fff16e19850 R08: 0000000000000003 R09: 0000000000000000
R10: 0000000000011012 R11: 0000000000000246 R12: 0000000000000004
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
</TASK>
------------[ cut here ]------------
kernel BUG at mm/page_table_check.c:142!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 5004 Comm: syz-executor464 Not tainted 6.4.0-rc2-syzkaller-00015-g1b66c114d161 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023
RIP: 0010:__page_table_check_zero+0x175/0x1c0 mm/page_table_check.c:142
Code: 24 08 80 38 00 75 47 48 03 2d f7 d4 04 10 49 83 c4 01 e9 00 ff ff ff e8 79 50 a2 ff 0f 0b e8 72 50 a2 ff 0f 0b e8 6b 50 a2 ff <0f> 0b e8 64 50 a2 ff 0f 0b e8 5d 50 a2 ff 48 89 ef 48 83 c4 10 5b
RSP: 0018:ffffc90003b3fa10 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000
RDX: ffff8880220c0000 RSI: ffffffff81e1f265 RDI: 0000000000000005
RBP: ffff888016090000 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000001 R11: 1ffffffff18f47c1 R12: 0000000000000000
R13: 000000000000000a R14: 0000000000000400 R15: dffffc0000000000
FS: 00005555572c2300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000000064392c CR3: 000000007abec000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
page_table_check_free include/linux/page_table_check.h:46 [inline]
free_pages_prepare mm/page_alloc.c:1303 [inline]
__free_pages_ok+0x9c8/0x1060 mm/page_alloc.c:1441
hcd_buffer_free+0x1b9/0x250 drivers/usb/core/buffer.c:163
usb_free_coherent+0x6b/0x80 drivers/usb/core/usb.c:1035
dec_usb_memory_use_count+0x253/0x3f0 drivers/usb/core/devio.c:197
usbdev_mmap+0x8d8/0xc40 drivers/usb/core/devio.c:277
call_mmap include/linux/fs.h:1873 [inline]
mmap_region+0x694/0x28d0 mm/mmap.c:2652
do_mmap+0x831/0xf60 mm/mmap.c:1394
vm_mmap_pgoff+0x1a2/0x3b0 mm/util.c:543
ksys_mmap_pgoff+0x41f/0x5a0 mm/mmap.c:1440
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:0x7fec20228c89
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:00007fff16e19838 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007fec20228c89
RDX: 0000000001000002 RSI: 0000000000400000 RDI: 0000000020000000
RBP: 00007fff16e19850 R08: 0000000000000003 R09: 0000000000000000
R10: 0000000000011012 R11: 0000000000000246 R12: 0000000000000004
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__page_table_check_zero+0x175/0x1c0 mm/page_table_check.c:142
Code: 24 08 80 38 00 75 47 48 03 2d f7 d4 04 10 49 83 c4 01 e9 00 ff ff ff e8 79 50 a2 ff 0f 0b e8 72 50 a2 ff 0f 0b e8 6b 50 a2 ff <0f> 0b e8 64 50 a2 ff 0f 0b e8 5d 50 a2 ff 48 89 ef 48 83 c4 10 5b
RSP: 0018:ffffc90003b3fa10 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000
RDX: ffff8880220c0000 RSI: ffffffff81e1f265 RDI: 0000000000000005
RBP: ffff888016090000 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000001 R11: 1ffffffff18f47c1 R12: 0000000000000000
R13: 000000000000000a R14: 0000000000000400 R15: dffffc0000000000
FS: 00005555572c2300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000056248b8b7008 CR3: 000000007abec000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to change bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [syzbot] Discardable change
2023-05-21 16:20 [syzbot] [mm?] kernel BUG in __page_table_check_zero syzbot
@ 2023-11-10 15:22 ` syzbot
2023-11-10 17:28 ` syzbot
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2023-11-10 15:22 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Discardable change
Author: yuran.pereira@hotmail.com
#syz test:
https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git master
---
drivers/usb/core/devio.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 3beb6a862e80..22ae7babf46b 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -276,12 +276,14 @@ static int usbdev_mmap(struct file *file, struct vm_area_struct *vma)
if (remap_pfn_range(vma, vma->vm_start,
virt_to_phys(usbm->mem) >> PAGE_SHIFT,
size, vma->vm_page_prot) < 0) {
+ pr_info("==> if* vma_use_count %d\n", usbm->vma_use_count);
dec_usb_memory_use_count(usbm, &usbm->vma_use_count);
return -EAGAIN;
}
} else {
if (dma_mmap_coherent(hcd->self.sysdev, vma, mem, dma_handle,
size)) {
+ pr_info("==> else* vma_use_count %d\n", usbm->vma_use_count);
dec_usb_memory_use_count(usbm, &usbm->vma_use_count);
return -EAGAIN;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [syzbot] Discardable change
2023-05-21 16:20 [syzbot] [mm?] kernel BUG in __page_table_check_zero syzbot
2023-11-10 15:22 ` [syzbot] Discardable change syzbot
@ 2023-11-10 17:28 ` syzbot
2023-11-10 18:06 ` syzbot
2024-10-20 18:12 ` [syzbot] [usb] kernel BUG in __page_table_check_zero syzbot
3 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2023-11-10 17:28 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Discardable change
Author: yuran.pereira@hotmail.com
#syz test: https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git master
---
drivers/usb/core/devio.c | 2 ++
include/linux/page_ext.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 3beb6a862e80..22ae7babf46b 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -276,12 +276,14 @@ static int usbdev_mmap(struct file *file, struct vm_area_struct *vma)
if (remap_pfn_range(vma, vma->vm_start,
virt_to_phys(usbm->mem) >> PAGE_SHIFT,
size, vma->vm_page_prot) < 0) {
+ pr_info("==> if* vma_use_count %d\n", usbm->vma_use_count);
dec_usb_memory_use_count(usbm, &usbm->vma_use_count);
return -EAGAIN;
}
} else {
if (dma_mmap_coherent(hcd->self.sysdev, vma, mem, dma_handle,
size)) {
+ pr_info("==> else* vma_use_count %d\n", usbm->vma_use_count);
dec_usb_memory_use_count(usbm, &usbm->vma_use_count);
return -EAGAIN;
}
diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h
index be98564191e6..fb3e7dcfbffb 100644
--- a/include/linux/page_ext.h
+++ b/include/linux/page_ext.h
@@ -84,6 +84,7 @@ extern void page_ext_put(struct page_ext *page_ext);
static inline void *page_ext_data(struct page_ext *page_ext,
struct page_ext_operations *ops)
{
+ pr_info("==> offset = %ld\n", ops->offset);
return (void *)(page_ext) + ops->offset;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [syzbot] Discardable change
2023-05-21 16:20 [syzbot] [mm?] kernel BUG in __page_table_check_zero syzbot
2023-11-10 15:22 ` [syzbot] Discardable change syzbot
2023-11-10 17:28 ` syzbot
@ 2023-11-10 18:06 ` syzbot
2024-10-20 18:12 ` [syzbot] [usb] kernel BUG in __page_table_check_zero syzbot
3 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2023-11-10 18:06 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Discardable change
Author: yuran.pereira@hotmail.com
#syz test: https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git master
---
drivers/usb/core/devio.c | 2 ++
mm/page_table_check.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 3beb6a862e80..22ae7babf46b 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -276,12 +276,14 @@ static int usbdev_mmap(struct file *file, struct vm_area_struct *vma)
if (remap_pfn_range(vma, vma->vm_start,
virt_to_phys(usbm->mem) >> PAGE_SHIFT,
size, vma->vm_page_prot) < 0) {
+ pr_info("==> if* vma_use_count %d\n", usbm->vma_use_count);
dec_usb_memory_use_count(usbm, &usbm->vma_use_count);
return -EAGAIN;
}
} else {
if (dma_mmap_coherent(hcd->self.sysdev, vma, mem, dma_handle,
size)) {
+ pr_info("==> else* vma_use_count %d\n", usbm->vma_use_count);
dec_usb_memory_use_count(usbm, &usbm->vma_use_count);
return -EAGAIN;
}
diff --git a/mm/page_table_check.c b/mm/page_table_check.c
index af69c3c8f7c2..ef0fb410cf10 100644
--- a/mm/page_table_check.c
+++ b/mm/page_table_check.c
@@ -142,6 +142,8 @@ void __page_table_check_zero(struct page *page, unsigned int order)
for (i = 0; i < (1ul << order); i++) {
struct page_table_check *ptc = get_page_table_check(page_ext);
+ pr_info("===> anon check_zero %d\n", atomic_read(&ptc->anon_map_count));
+ pr_info("===> fmap check_zero %d\n", atomic_read(&ptc->file_map_count));
BUG_ON(atomic_read(&ptc->anon_map_count));
BUG_ON(atomic_read(&ptc->file_map_count));
page_ext = page_ext_next(page_ext);
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [syzbot] [usb] kernel BUG in __page_table_check_zero
2023-05-21 16:20 [syzbot] [mm?] kernel BUG in __page_table_check_zero syzbot
` (2 preceding siblings ...)
2023-11-10 18:06 ` syzbot
@ 2024-10-20 18:12 ` syzbot
2024-10-20 20:31 ` Linus Torvalds
3 siblings, 1 reply; 7+ messages in thread
From: syzbot @ 2024-10-20 18:12 UTC (permalink / raw)
To: akpm, jannh, linux-kernel, linux-mm, linux-usb, pasha.tatashin,
syzkaller-bugs, torvalds, yuran.pereira
syzbot suspects this issue was fixed by commit:
commit 79a61cc3fc0466ad2b7b89618a6157785f0293b3
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Thu Sep 12 00:11:23 2024 +0000
mm: avoid leaving partial pfn mappings around in error case
bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11f76c87980000
start commit: cbf3a2cb156a Merge tag 'nfs-for-6.6-3' of git://git.linux-..
git tree: upstream
kernel config: https://syzkaller.appspot.com/x/.config?x=57da1ac039c4c78a
dashboard link: https://syzkaller.appspot.com/bug?extid=7a9bbb158a7a1071eb27
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15394721680000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=152b7af6680000
If the result looks correct, please mark the issue as fixed by replying with:
#syz fix: mm: avoid leaving partial pfn mappings around in error case
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [syzbot] [usb] kernel BUG in __page_table_check_zero
2024-10-20 18:12 ` [syzbot] [usb] kernel BUG in __page_table_check_zero syzbot
@ 2024-10-20 20:31 ` Linus Torvalds
2024-10-21 14:17 ` Jann Horn
0 siblings, 1 reply; 7+ messages in thread
From: Linus Torvalds @ 2024-10-20 20:31 UTC (permalink / raw)
To: syzbot
Cc: akpm, jannh, linux-kernel, linux-mm, linux-usb, pasha.tatashin,
syzkaller-bugs, yuran.pereira
#syz fix: mm: avoid leaving partial pfn mappings around in error case
Because even if I wasn't aware of the syzbot report, it does look like
a match for what the commit was meant to fix (and may have been the
source of Jann's report).
Linus
On Sun, 20 Oct 2024 at 11:12, syzbot
<syzbot+7a9bbb158a7a1071eb27@syzkaller.appspotmail.com> wrote:
>
> If the result looks correct, please mark the issue as fixed by replying with:
>
> #syz fix: mm: avoid leaving partial pfn mappings around in error case
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [syzbot] [usb] kernel BUG in __page_table_check_zero
2024-10-20 20:31 ` Linus Torvalds
@ 2024-10-21 14:17 ` Jann Horn
0 siblings, 0 replies; 7+ messages in thread
From: Jann Horn @ 2024-10-21 14:17 UTC (permalink / raw)
To: Linus Torvalds
Cc: syzbot, akpm, linux-kernel, linux-mm, linux-usb, pasha.tatashin,
syzkaller-bugs, yuran.pereira
On Sun, Oct 20, 2024 at 10:32 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> Because even if I wasn't aware of the syzbot report, it does look like
> a match for what the commit was meant to fix (and may have been the
> source of Jann's report).
Huh, I had no idea syzkaller had already found this one... neat.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-10-21 14:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-21 16:20 [syzbot] [mm?] kernel BUG in __page_table_check_zero syzbot
2023-11-10 15:22 ` [syzbot] Discardable change syzbot
2023-11-10 17:28 ` syzbot
2023-11-10 18:06 ` syzbot
2024-10-20 18:12 ` [syzbot] [usb] kernel BUG in __page_table_check_zero syzbot
2024-10-20 20:31 ` Linus Torvalds
2024-10-21 14:17 ` Jann Horn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox