* 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