public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [io-uring?] KASAN: null-ptr-deref Read in io_sqe_buffer_register
@ 2025-09-04 15:36 syzbot
  2025-09-04 23:20 ` Jens Axboe
  2025-09-08  4:30 ` syzbot
  0 siblings, 2 replies; 10+ messages in thread
From: syzbot @ 2025-09-04 15:36 UTC (permalink / raw)
  To: axboe, io-uring, linux-kernel, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    4ac65880ebca Add linux-next specific files for 20250904
git tree:       linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=1785fe62580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=fbc16d9faf3a88a4
dashboard link: https://syzkaller.appspot.com/bug?extid=1ab243d3eebb2aabf4a4
compiler:       Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13f23e62580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=12cb6312580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/36645a51612c/disk-4ac65880.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/bba80d634bef/vmlinux-4ac65880.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e58dd70dfd0f/bzImage-4ac65880.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+1ab243d3eebb2aabf4a4@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read include/linux/instrumented.h:68 [inline]
BUG: KASAN: null-ptr-deref in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
BUG: KASAN: null-ptr-deref in PageCompound include/linux/page-flags.h:331 [inline]
BUG: KASAN: null-ptr-deref in io_buffer_account_pin io_uring/rsrc.c:668 [inline]
BUG: KASAN: null-ptr-deref in io_sqe_buffer_register+0x369/0x20a0 io_uring/rsrc.c:817
Read of size 8 at addr 0000000000000000 by task syz.0.17/6020

CPU: 0 UID: 0 PID: 6020 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 kasan_report+0x118/0x150 mm/kasan/report.c:595
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x2b0/0x2c0 mm/kasan/generic.c:200
 instrument_atomic_read include/linux/instrumented.h:68 [inline]
 _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
 PageCompound include/linux/page-flags.h:331 [inline]
 io_buffer_account_pin io_uring/rsrc.c:668 [inline]
 io_sqe_buffer_register+0x369/0x20a0 io_uring/rsrc.c:817
 __io_sqe_buffers_update io_uring/rsrc.c:322 [inline]
 __io_register_rsrc_update+0x55e/0x11b0 io_uring/rsrc.c:360
 io_register_rsrc_update+0x196/0x1a0 io_uring/rsrc.c:391
 __io_uring_register io_uring/register.c:736 [inline]
 __do_sys_io_uring_register io_uring/register.c:926 [inline]
 __se_sys_io_uring_register+0x795/0x11b0 io_uring/register.c:903
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f99b1f8ebe9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f99b2d88038 EFLAGS: 00000246 ORIG_RAX: 00000000000001ab
RAX: ffffffffffffffda RBX: 00007f99b21c5fa0 RCX: 00007f99b1f8ebe9
RDX: 00002000000003c0 RSI: 0000000000000010 RDI: 0000000000000003
RBP: 00007f99b2011e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000020 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f99b21c6038 R14: 00007f99b21c5fa0 R15: 00007ffeadfa5958
 </TASK>
==================================================================


---
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 report is already addressed, 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 overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: null-ptr-deref Read in io_sqe_buffer_register
  2025-09-04 15:36 [syzbot] [io-uring?] KASAN: null-ptr-deref Read in io_sqe_buffer_register syzbot
@ 2025-09-04 23:20 ` Jens Axboe
  2025-09-05  3:25   ` Andrew Morton
  2025-09-05  7:42   ` David Hildenbrand
  2025-09-08  4:30 ` syzbot
  1 sibling, 2 replies; 10+ messages in thread
From: Jens Axboe @ 2025-09-04 23:20 UTC (permalink / raw)
  To: syzbot, io-uring, linux-kernel, syzkaller-bugs, Andrew Morton,
	David Hildenbrand

On 9/4/25 9:36 AM, syzbot wrote:
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    4ac65880ebca Add linux-next specific files for 20250904
> git tree:       linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=1785fe62580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=fbc16d9faf3a88a4
> dashboard link: https://syzkaller.appspot.com/bug?extid=1ab243d3eebb2aabf4a4
> compiler:       Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13f23e62580000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=12cb6312580000
> 
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/36645a51612c/disk-4ac65880.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/bba80d634bef/vmlinux-4ac65880.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/e58dd70dfd0f/bzImage-4ac65880.xz
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+1ab243d3eebb2aabf4a4@syzkaller.appspotmail.com
> 
> ==================================================================
> BUG: KASAN: null-ptr-deref in instrument_atomic_read include/linux/instrumented.h:68 [inline]
> BUG: KASAN: null-ptr-deref in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
> BUG: KASAN: null-ptr-deref in PageCompound include/linux/page-flags.h:331 [inline]
> BUG: KASAN: null-ptr-deref in io_buffer_account_pin io_uring/rsrc.c:668 [inline]
> BUG: KASAN: null-ptr-deref in io_sqe_buffer_register+0x369/0x20a0 io_uring/rsrc.c:817
> Read of size 8 at addr 0000000000000000 by task syz.0.17/6020
> 
> CPU: 0 UID: 0 PID: 6020 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) 
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
> Call Trace:
>  <TASK>
>  dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
>  kasan_report+0x118/0x150 mm/kasan/report.c:595
>  check_region_inline mm/kasan/generic.c:-1 [inline]
>  kasan_check_range+0x2b0/0x2c0 mm/kasan/generic.c:200
>  instrument_atomic_read include/linux/instrumented.h:68 [inline]
>  _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
>  PageCompound include/linux/page-flags.h:331 [inline]
>  io_buffer_account_pin io_uring/rsrc.c:668 [inline]
>  io_sqe_buffer_register+0x369/0x20a0 io_uring/rsrc.c:817
>  __io_sqe_buffers_update io_uring/rsrc.c:322 [inline]
>  __io_register_rsrc_update+0x55e/0x11b0 io_uring/rsrc.c:360
>  io_register_rsrc_update+0x196/0x1a0 io_uring/rsrc.c:391
>  __io_uring_register io_uring/register.c:736 [inline]
>  __do_sys_io_uring_register io_uring/register.c:926 [inline]
>  __se_sys_io_uring_register+0x795/0x11b0 io_uring/register.c:903
>  do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
>  do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
>  entry_SYSCALL_64_after_hwframe+0x77/0x7f
> RIP: 0033:0x7f99b1f8ebe9
> Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
> RSP: 002b:00007f99b2d88038 EFLAGS: 00000246 ORIG_RAX: 00000000000001ab
> RAX: ffffffffffffffda RBX: 00007f99b21c5fa0 RCX: 00007f99b1f8ebe9
> RDX: 00002000000003c0 RSI: 0000000000000010 RDI: 0000000000000003
> RBP: 00007f99b2011e19 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000020 R11: 0000000000000246 R12: 0000000000000000
> R13: 00007f99b21c6038 R14: 00007f99b21c5fa0 R15: 00007ffeadfa5958
>  </TASK>
> ==================================================================

This is from the mm-unstable changes in linux-next, adding David as I
ran a quick bisect and it said:

da6b34293ff8dbb78f8b9278c9a492925bbf1f87 is the first bad commit
commit da6b34293ff8dbb78f8b9278c9a492925bbf1f87
Author: David Hildenbrand <david@redhat.com>
Date:   Mon Sep 1 17:03:40 2025 +0200

    mm/gup: remove record_subpages()
    
    We can just cleanup the code by calculating the #refs earlier, so we can
    just inline what remains of record_subpages().
    
    Calculate the number of references/pages ahead of times, and record them
    only once all our tests passed.
    
    Link: https://lkml.kernel.org/r/20250901150359.867252-20-david@redhat.com
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

I won't personally have time to look into this until after the weekend,
but as it's linux-next specific, not a huge deal right now.

Note that there's also a similar report, which is the same thing:

https://lore.kernel.org/all/68b9d130.a00a0220.eb3d.0008.GAE@google.com/

which I marked as dupe of this one.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: null-ptr-deref Read in io_sqe_buffer_register
  2025-09-04 23:20 ` Jens Axboe
@ 2025-09-05  3:25   ` Andrew Morton
  2025-09-05  6:34     ` David Hildenbrand
  2025-09-05  7:42   ` David Hildenbrand
  1 sibling, 1 reply; 10+ messages in thread
From: Andrew Morton @ 2025-09-05  3:25 UTC (permalink / raw)
  To: Jens Axboe
  Cc: syzbot, io-uring, linux-kernel, syzkaller-bugs, David Hildenbrand

On Thu, 4 Sep 2025 17:20:41 -0600 Jens Axboe <axboe@kernel.dk> wrote:

> > ==================================================================
> 
> This is from the mm-unstable changes in linux-next, adding David as I
> ran a quick bisect and it said:
> 
> da6b34293ff8dbb78f8b9278c9a492925bbf1f87 is the first bad commit
> commit da6b34293ff8dbb78f8b9278c9a492925bbf1f87
> Author: David Hildenbrand <david@redhat.com>
> Date:   Mon Sep 1 17:03:40 2025 +0200
> 
>     mm/gup: remove record_subpages()
>     
>     We can just cleanup the code by calculating the #refs earlier, so we can
>     just inline what remains of record_subpages().
>     
>     Calculate the number of references/pages ahead of times, and record them
>     only once all our tests passed.
>     
>     Link: https://lkml.kernel.org/r/20250901150359.867252-20-david@redhat.com
>     Signed-off-by: David Hildenbrand <david@redhat.com>
>     Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> 
> I won't personally have time to look into this until after the weekend,
> but as it's linux-next specific, not a huge deal right now.
> 
> Note that there's also a similar report, which is the same thing:
> 
> https://lore.kernel.org/all/68b9d130.a00a0220.eb3d.0008.GAE@google.com/
> 
> which I marked as dupe of this one.

Thanks.  Seems i can remove that patch without causing merge or build
damage, so I'll do that.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: null-ptr-deref Read in io_sqe_buffer_register
  2025-09-05  3:25   ` Andrew Morton
@ 2025-09-05  6:34     ` David Hildenbrand
  0 siblings, 0 replies; 10+ messages in thread
From: David Hildenbrand @ 2025-09-05  6:34 UTC (permalink / raw)
  To: Andrew Morton, Jens Axboe; +Cc: syzbot, io-uring, linux-kernel, syzkaller-bugs

On 05.09.25 05:25, Andrew Morton wrote:
> On Thu, 4 Sep 2025 17:20:41 -0600 Jens Axboe <axboe@kernel.dk> wrote:
> 
>>> ==================================================================
>>
>> This is from the mm-unstable changes in linux-next, adding David as I
>> ran a quick bisect and it said:
>>
>> da6b34293ff8dbb78f8b9278c9a492925bbf1f87 is the first bad commit
>> commit da6b34293ff8dbb78f8b9278c9a492925bbf1f87
>> Author: David Hildenbrand <david@redhat.com>
>> Date:   Mon Sep 1 17:03:40 2025 +0200
>>
>>      mm/gup: remove record_subpages()
>>      
>>      We can just cleanup the code by calculating the #refs earlier, so we can
>>      just inline what remains of record_subpages().
>>      
>>      Calculate the number of references/pages ahead of times, and record them
>>      only once all our tests passed.
>>      
>>      Link: https://lkml.kernel.org/r/20250901150359.867252-20-david@redhat.com
>>      Signed-off-by: David Hildenbrand <david@redhat.com>
>>      Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>>
>> I won't personally have time to look into this until after the weekend,
>> but as it's linux-next specific, not a huge deal right now.
>>
>> Note that there's also a similar report, which is the same thing:
>>
>> https://lore.kernel.org/all/68b9d130.a00a0220.eb3d.0008.GAE@google.com/
>>
>> which I marked as dupe of this one.
> 
> Thanks.  Seems i can remove that patch without causing merge or build
> damage, so I'll do that.

Thanks, I shall go and figure out what I messed up there. I'll then 
reply to the v2 of the patch with a fixup.

-- 
Cheers

David / dhildenb


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: null-ptr-deref Read in io_sqe_buffer_register
  2025-09-04 23:20 ` Jens Axboe
  2025-09-05  3:25   ` Andrew Morton
@ 2025-09-05  7:42   ` David Hildenbrand
  2025-09-05  9:41     ` syzbot
  2025-09-06  2:01     ` Andrew Morton
  1 sibling, 2 replies; 10+ messages in thread
From: David Hildenbrand @ 2025-09-05  7:42 UTC (permalink / raw)
  To: Jens Axboe, syzbot, io-uring, linux-kernel, syzkaller-bugs,
	Andrew Morton

On 05.09.25 01:20, Jens Axboe wrote:
> On 9/4/25 9:36 AM, syzbot wrote:
>> Hello,
>>
>> syzbot found the following issue on:
>>
>> HEAD commit:    4ac65880ebca Add linux-next specific files for 20250904
>> git tree:       linux-next
>> console output: https://syzkaller.appspot.com/x/log.txt?x=1785fe62580000
>> kernel config:  https://syzkaller.appspot.com/x/.config?x=fbc16d9faf3a88a4
>> dashboard link: https://syzkaller.appspot.com/bug?extid=1ab243d3eebb2aabf4a4
>> compiler:       Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
>> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13f23e62580000
>> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=12cb6312580000
>>
>> Downloadable assets:
>> disk image: https://storage.googleapis.com/syzbot-assets/36645a51612c/disk-4ac65880.raw.xz
>> vmlinux: https://storage.googleapis.com/syzbot-assets/bba80d634bef/vmlinux-4ac65880.xz
>> kernel image: https://storage.googleapis.com/syzbot-assets/e58dd70dfd0f/bzImage-4ac65880.xz
>>
>> IMPORTANT: if you fix the issue, please add the following tag to the commit:
>> Reported-by: syzbot+1ab243d3eebb2aabf4a4@syzkaller.appspotmail.com
>>
>> ==================================================================
>> BUG: KASAN: null-ptr-deref in instrument_atomic_read include/linux/instrumented.h:68 [inline]
>> BUG: KASAN: null-ptr-deref in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
>> BUG: KASAN: null-ptr-deref in PageCompound include/linux/page-flags.h:331 [inline]
>> BUG: KASAN: null-ptr-deref in io_buffer_account_pin io_uring/rsrc.c:668 [inline]
>> BUG: KASAN: null-ptr-deref in io_sqe_buffer_register+0x369/0x20a0 io_uring/rsrc.c:817
>> Read of size 8 at addr 0000000000000000 by task syz.0.17/6020
>>
>> CPU: 0 UID: 0 PID: 6020 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full)
>> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
>> Call Trace:
>>   <TASK>
>>   dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
>>   kasan_report+0x118/0x150 mm/kasan/report.c:595
>>   check_region_inline mm/kasan/generic.c:-1 [inline]
>>   kasan_check_range+0x2b0/0x2c0 mm/kasan/generic.c:200
>>   instrument_atomic_read include/linux/instrumented.h:68 [inline]
>>   _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
>>   PageCompound include/linux/page-flags.h:331 [inline]
>>   io_buffer_account_pin io_uring/rsrc.c:668 [inline]
>>   io_sqe_buffer_register+0x369/0x20a0 io_uring/rsrc.c:817
>>   __io_sqe_buffers_update io_uring/rsrc.c:322 [inline]
>>   __io_register_rsrc_update+0x55e/0x11b0 io_uring/rsrc.c:360
>>   io_register_rsrc_update+0x196/0x1a0 io_uring/rsrc.c:391
>>   __io_uring_register io_uring/register.c:736 [inline]
>>   __do_sys_io_uring_register io_uring/register.c:926 [inline]
>>   __se_sys_io_uring_register+0x795/0x11b0 io_uring/register.c:903
>>   do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
>>   do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
>>   entry_SYSCALL_64_after_hwframe+0x77/0x7f
>> RIP: 0033:0x7f99b1f8ebe9
>> Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
>> RSP: 002b:00007f99b2d88038 EFLAGS: 00000246 ORIG_RAX: 00000000000001ab
>> RAX: ffffffffffffffda RBX: 00007f99b21c5fa0 RCX: 00007f99b1f8ebe9
>> RDX: 00002000000003c0 RSI: 0000000000000010 RDI: 0000000000000003
>> RBP: 00007f99b2011e19 R08: 0000000000000000 R09: 0000000000000000
>> R10: 0000000000000020 R11: 0000000000000246 R12: 0000000000000000
>> R13: 00007f99b21c6038 R14: 00007f99b21c5fa0 R15: 00007ffeadfa5958
>>   </TASK>
>> ==================================================================

#syz test

 From bfd07c995814354f6b66c5b6a72e96a7aa9fb73b Mon Sep 17 00:00:00 2001
From: David Hildenbrand <david@redhat.com>
Date: Fri, 5 Sep 2025 08:38:43 +0200
Subject: [PATCH] fixup: mm/gup: remove record_subpages()

pages is not adjusted by the caller, but idnexed by existing *nr.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
  mm/gup.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/mm/gup.c b/mm/gup.c
index 010fe56f6e132..22420f2069ee1 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -2981,6 +2981,7 @@ static int gup_fast_pmd_leaf(pmd_t orig, pmd_t 
*pmdp, unsigned long addr,
  		return 0;
  	}

+	pages += *nr;
  	*nr += refs;
  	for (; refs; refs--)
  		*(pages++) = page++;
@@ -3024,6 +3025,7 @@ static int gup_fast_pud_leaf(pud_t orig, pud_t 
*pudp, unsigned long addr,
  		return 0;
  	}

+	pages += *nr;
  	*nr += refs;
  	for (; refs; refs--)
  		*(pages++) = page++;
-- 
2.50.1


-- 
Cheers

David / dhildenb


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: null-ptr-deref Read in io_sqe_buffer_register
  2025-09-05  7:42   ` David Hildenbrand
@ 2025-09-05  9:41     ` syzbot
  2025-09-05 10:04       ` David Hildenbrand
  2025-09-06  2:01     ` Andrew Morton
  1 sibling, 1 reply; 10+ messages in thread
From: syzbot @ 2025-09-05  9:41 UTC (permalink / raw)
  To: akpm, axboe, david, io-uring, linux-kernel, syzkaller-bugs

Hello,

syzbot tried to test the proposed patch but the build/boot failed:

failed to apply patch:
checking file mm/gup.c
patch: **** unexpected end of file in patch



Tested on:

commit:         be5d4872 Add linux-next specific files for 20250905
git tree:       linux-next
kernel config:  https://syzkaller.appspot.com/x/.config?x=fbc16d9faf3a88a4
dashboard link: https://syzkaller.appspot.com/bug?extid=1ab243d3eebb2aabf4a4
compiler:       
patch:          https://syzkaller.appspot.com/x/patch.diff?x=1127e962580000


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: null-ptr-deref Read in io_sqe_buffer_register
  2025-09-05  9:41     ` syzbot
@ 2025-09-05 10:04       ` David Hildenbrand
  2025-09-05 10:48         ` syzbot
  0 siblings, 1 reply; 10+ messages in thread
From: David Hildenbrand @ 2025-09-05 10:04 UTC (permalink / raw)
  To: syzbot, akpm, axboe, io-uring, linux-kernel, syzkaller-bugs

On 05.09.25 11:41, syzbot wrote:
> Hello,
> 
> syzbot tried to test the proposed patch but the build/boot failed:
> 
> failed to apply patch:
> checking file mm/gup.c
> patch: **** unexpected end of file in patch
> 
> 
> 
> Tested on:
> 
> commit:         be5d4872 Add linux-next specific files for 20250905
> git tree:       linux-next
> kernel config:  https://syzkaller.appspot.com/x/.config?x=fbc16d9faf3a88a4
> dashboard link: https://syzkaller.appspot.com/bug?extid=1ab243d3eebb2aabf4a4
> compiler:
> patch:          https://syzkaller.appspot.com/x/patch.diff?x=1127e962580000
> 

#syz test https://github.com/davidhildenbrand/linux.git nth_page

-- 
Cheers

David / dhildenb


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: null-ptr-deref Read in io_sqe_buffer_register
  2025-09-05 10:04       ` David Hildenbrand
@ 2025-09-05 10:48         ` syzbot
  0 siblings, 0 replies; 10+ messages in thread
From: syzbot @ 2025-09-05 10:48 UTC (permalink / raw)
  To: akpm, axboe, david, io-uring, linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+1ab243d3eebb2aabf4a4@syzkaller.appspotmail.com
Tested-by: syzbot+1ab243d3eebb2aabf4a4@syzkaller.appspotmail.com

Tested on:

commit:         bfd07c99 fixup: mm/gup: remove record_subpages()
git tree:       https://github.com/davidhildenbrand/linux.git nth_page
console output: https://syzkaller.appspot.com/x/log.txt?x=15a5a134580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=366a4ffc91f4ab4
dashboard link: https://syzkaller.appspot.com/bug?extid=1ab243d3eebb2aabf4a4
compiler:       Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8

Note: no patches were applied.
Note: testing is done by a robot and is best-effort only.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: null-ptr-deref Read in io_sqe_buffer_register
  2025-09-05  7:42   ` David Hildenbrand
  2025-09-05  9:41     ` syzbot
@ 2025-09-06  2:01     ` Andrew Morton
  1 sibling, 0 replies; 10+ messages in thread
From: Andrew Morton @ 2025-09-06  2:01 UTC (permalink / raw)
  To: David Hildenbrand
  Cc: Jens Axboe, syzbot, io-uring, linux-kernel, syzkaller-bugs

On Fri, 5 Sep 2025 09:42:55 +0200 David Hildenbrand <david@redhat.com> wrote:

> #syz test
> 
>  From bfd07c995814354f6b66c5b6a72e96a7aa9fb73b Mon Sep 17 00:00:00 2001
> From: David Hildenbrand <david@redhat.com>
> Date: Fri, 5 Sep 2025 08:38:43 +0200
> Subject: [PATCH] fixup: mm/gup: remove record_subpages()
> 
> pages is not adjusted by the caller, but idnexed by existing *nr.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>

Cool, I resurrected "mm/gup: remove record_subpages()" and added the -fix:

From: David Hildenbrand <david@redhat.com>
Subject: fixup: mm/gup: remove record_subpages()
Date: Fri, 5 Sep 2025 08:38:43 +0200

pages is not adjusted by the caller, but indexed by existing *nr.

Link: https://lkml.kernel.org/r/cc7f03f8-da8b-407e-a03a-e8e5a9ec5462@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reported-by: syzbot+1ab243d3eebb2aabf4a4@syzkaller.appspotmail.com
Tested-by: syzbot+1ab243d3eebb2aabf4a4@syzkaller.appspotmail.com
Reported-by: Jens Axboe <axboe@kernel.dk>
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/gup.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/mm/gup.c~mm-gup-remove-record_subpages-fix
+++ a/mm/gup.c
@@ -2966,6 +2966,7 @@ static int gup_fast_pmd_leaf(pmd_t orig,
 		return 0;
 	}
 
+	pages += *nr;
 	*nr += refs;
 	for (; refs; refs--)
 		*(pages++) = page++;
@@ -3009,6 +3010,7 @@ static int gup_fast_pud_leaf(pud_t orig,
 		return 0;
 	}
 
+	pages += *nr;
 	*nr += refs;
 	for (; refs; refs--)
 		*(pages++) = page++;
_


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [syzbot] [io-uring?] KASAN: null-ptr-deref Read in io_sqe_buffer_register
  2025-09-04 15:36 [syzbot] [io-uring?] KASAN: null-ptr-deref Read in io_sqe_buffer_register syzbot
  2025-09-04 23:20 ` Jens Axboe
@ 2025-09-08  4:30 ` syzbot
  1 sibling, 0 replies; 10+ messages in thread
From: syzbot @ 2025-09-08  4:30 UTC (permalink / raw)
  To: akpm, axboe, david, io-uring, jgg, jhubbard, linux-kernel,
	linux-mm, peterx, syzkaller-bugs

syzbot has bisected this issue to:

commit da6b34293ff8dbb78f8b9278c9a492925bbf1f87
Author: David Hildenbrand <david@redhat.com>
Date:   Mon Sep 1 15:03:40 2025 +0000

    mm/gup: remove record_subpages()

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=1240f962580000
start commit:   4ac65880ebca Add linux-next specific files for 20250904
git tree:       linux-next
final oops:     https://syzkaller.appspot.com/x/report.txt?x=1140f962580000
console output: https://syzkaller.appspot.com/x/log.txt?x=1640f962580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=fbc16d9faf3a88a4
dashboard link: https://syzkaller.appspot.com/bug?extid=1ab243d3eebb2aabf4a4
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=12a0e312580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=101e3e62580000

Reported-by: syzbot+1ab243d3eebb2aabf4a4@syzkaller.appspotmail.com
Fixes: da6b34293ff8 ("mm/gup: remove record_subpages()")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-09-08  4:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-04 15:36 [syzbot] [io-uring?] KASAN: null-ptr-deref Read in io_sqe_buffer_register syzbot
2025-09-04 23:20 ` Jens Axboe
2025-09-05  3:25   ` Andrew Morton
2025-09-05  6:34     ` David Hildenbrand
2025-09-05  7:42   ` David Hildenbrand
2025-09-05  9:41     ` syzbot
2025-09-05 10:04       ` David Hildenbrand
2025-09-05 10:48         ` syzbot
2025-09-06  2:01     ` Andrew Morton
2025-09-08  4:30 ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox