linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* general protection fault in percpu_ref_exit
@ 2020-10-08 15:09 syzbot
  2020-10-08 20:28 ` syzbot
  0 siblings, 1 reply; 4+ messages in thread
From: syzbot @ 2020-10-08 15:09 UTC (permalink / raw)
  To: bcrl, linux-aio, linux-fsdevel, linux-kernel, syzkaller-bugs, viro

Hello,

syzbot found the following issue on:

HEAD commit:    8b787da7 Add linux-next specific files for 20201007
git tree:       linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=15b6734f900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=aac055e9c8fbd2b8
dashboard link: https://syzkaller.appspot.com/bug?extid=fd15ff734dace9e16437
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=119a0568500000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=106c0a8b900000

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

RDX: 0000000000000001 RSI: 0000000020000140 RDI: 000000000000f501
RBP: 00000000006dbc20 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dbc2c
R13: 00007ffe36a84a0f R14: 00007f51c77e59c0 R15: 0000000000000000
general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
CPU: 1 PID: 6924 Comm: syz-executor821 Not tainted 5.9.0-rc8-next-20201007-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__percpu_ref_exit lib/percpu-refcount.c:112 [inline]
RIP: 0010:percpu_ref_exit+0x7f/0x210 lib/percpu-refcount.c:133
Code: e5 fc 48 89 ee e8 01 42 b9 fd 48 85 ed 74 60 e8 77 45 b9 fd 49 8d 7c 24 10 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 26 01 00 00 49 83 7c 24 10 00 0f 85 01 01 00 00
RSP: 0018:ffffc900054b7de0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff88802feb1658 RCX: ffffffff83bc130f
RDX: 0000000000000002 RSI: ffffffff83bc1319 RDI: 0000000000000010
RBP: 0000607f51875180 R08: 0000000000000001 R09: ffff88802feb1807
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88802feb1660 R14: ffff88802feb1800 R15: ffff88802feb1670
FS:  00007f51c77e5700(0000) GS:ffff8880ae500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000140 CR3: 0000000012424000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 ioctx_alloc+0x2d2/0x1d60 fs/aio.c:804
 __do_sys_io_setup fs/aio.c:1326 [inline]
 __se_sys_io_setup fs/aio.c:1309 [inline]
 __x64_sys_io_setup+0xe9/0x230 fs/aio.c:1309
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x446769
Code: e8 bc b5 02 00 48 83 c4 18 c3 0f 1f 80 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 0f 83 ab 08 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f51c77e4db8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ce
RAX: ffffffffffffffda RBX: 00000000006dbc28 RCX: 0000000000446769
RDX: 0000000000000001 RSI: 0000000020000140 RDI: 000000000000f501
RBP: 00000000006dbc20 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dbc2c
R13: 00007ffe36a84a0f R14: 00007f51c77e59c0 R15: 0000000000000000
Modules linked in:
---[ end trace 000c19ea8a5922ba ]---
RIP: 0010:__percpu_ref_exit lib/percpu-refcount.c:112 [inline]
RIP: 0010:percpu_ref_exit+0x7f/0x210 lib/percpu-refcount.c:133
Code: e5 fc 48 89 ee e8 01 42 b9 fd 48 85 ed 74 60 e8 77 45 b9 fd 49 8d 7c 24 10 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 26 01 00 00 49 83 7c 24 10 00 0f 85 01 01 00 00
RSP: 0018:ffffc900054b7de0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff88802feb1658 RCX: ffffffff83bc130f
RDX: 0000000000000002 RSI: ffffffff83bc1319 RDI: 0000000000000010
RBP: 0000607f51875180 R08: 0000000000000001 R09: ffff88802feb1807
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88802feb1660 R14: ffff88802feb1800 R15: ffff88802feb1670
FS:  00007f51c77e5700(0000) GS:ffff8880ae500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000140 CR3: 0000000012424000 CR4: 00000000001506e0
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.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

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

* Re: general protection fault in percpu_ref_exit
  2020-10-08 15:09 general protection fault in percpu_ref_exit syzbot
@ 2020-10-08 20:28 ` syzbot
  2020-10-09  1:23   ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: syzbot @ 2020-10-08 20:28 UTC (permalink / raw)
  To: axboe, bcrl, hch, linux-aio, linux-fsdevel, linux-kernel,
	ming.lei, syzkaller-bugs, tj, viro, vkabatov

syzbot has bisected this issue to:

commit 2b0d3d3e4fcfb19d10f9a82910b8f0f05c56ee3e
Author: Ming Lei <ming.lei@redhat.com>
Date:   Thu Oct 1 15:48:41 2020 +0000

    percpu_ref: reduce memory footprint of percpu_ref in fast path

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=126930d0500000
start commit:   8b787da7 Add linux-next specific files for 20201007
git tree:       linux-next
final oops:     https://syzkaller.appspot.com/x/report.txt?x=116930d0500000
console output: https://syzkaller.appspot.com/x/log.txt?x=166930d0500000
kernel config:  https://syzkaller.appspot.com/x/.config?x=aac055e9c8fbd2b8
dashboard link: https://syzkaller.appspot.com/bug?extid=fd15ff734dace9e16437
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=119a0568500000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=106c0a8b900000

Reported-by: syzbot+fd15ff734dace9e16437@syzkaller.appspotmail.com
Fixes: 2b0d3d3e4fcf ("percpu_ref: reduce memory footprint of percpu_ref in fast path")

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

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

* Re: general protection fault in percpu_ref_exit
  2020-10-08 20:28 ` syzbot
@ 2020-10-09  1:23   ` Jens Axboe
  2020-10-09  4:05     ` Ming Lei
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2020-10-09  1:23 UTC (permalink / raw)
  To: syzbot, bcrl, hch, linux-aio, linux-fsdevel, linux-kernel,
	ming.lei, syzkaller-bugs, tj, viro, vkabatov

On 10/8/20 2:28 PM, syzbot wrote:
> syzbot has bisected this issue to:
> 
> commit 2b0d3d3e4fcfb19d10f9a82910b8f0f05c56ee3e
> Author: Ming Lei <ming.lei@redhat.com>
> Date:   Thu Oct 1 15:48:41 2020 +0000
> 
>     percpu_ref: reduce memory footprint of percpu_ref in fast path
> 
> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=126930d0500000
> start commit:   8b787da7 Add linux-next specific files for 20201007
> git tree:       linux-next
> final oops:     https://syzkaller.appspot.com/x/report.txt?x=116930d0500000
> console output: https://syzkaller.appspot.com/x/log.txt?x=166930d0500000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=aac055e9c8fbd2b8
> dashboard link: https://syzkaller.appspot.com/bug?extid=fd15ff734dace9e16437
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=119a0568500000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=106c0a8b900000
> 
> Reported-by: syzbot+fd15ff734dace9e16437@syzkaller.appspotmail.com
> Fixes: 2b0d3d3e4fcf ("percpu_ref: reduce memory footprint of percpu_ref in fast path")
> 
> For information about bisection process see: https://goo.gl/tpsmEJ#bisection

Ming, this looks like a call of percpu_ref_exit() on a zeroed refs (that
hasn't been initialized). Really a caller error imho, but might make sense
to be a bit safer there.

-- 
Jens Axboe


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

* Re: general protection fault in percpu_ref_exit
  2020-10-09  1:23   ` Jens Axboe
@ 2020-10-09  4:05     ` Ming Lei
  0 siblings, 0 replies; 4+ messages in thread
From: Ming Lei @ 2020-10-09  4:05 UTC (permalink / raw)
  To: Jens Axboe
  Cc: syzbot, bcrl, hch, linux-aio, linux-fsdevel, linux-kernel,
	syzkaller-bugs, tj, viro, vkabatov

On Thu, Oct 08, 2020 at 07:23:02PM -0600, Jens Axboe wrote:
> On 10/8/20 2:28 PM, syzbot wrote:
> > syzbot has bisected this issue to:
> > 
> > commit 2b0d3d3e4fcfb19d10f9a82910b8f0f05c56ee3e
> > Author: Ming Lei <ming.lei@redhat.com>
> > Date:   Thu Oct 1 15:48:41 2020 +0000
> > 
> >     percpu_ref: reduce memory footprint of percpu_ref in fast path
> > 
> > bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=126930d0500000
> > start commit:   8b787da7 Add linux-next specific files for 20201007
> > git tree:       linux-next
> > final oops:     https://syzkaller.appspot.com/x/report.txt?x=116930d0500000
> > console output: https://syzkaller.appspot.com/x/log.txt?x=166930d0500000
> > kernel config:  https://syzkaller.appspot.com/x/.config?x=aac055e9c8fbd2b8
> > dashboard link: https://syzkaller.appspot.com/bug?extid=fd15ff734dace9e16437
> > syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=119a0568500000
> > C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=106c0a8b900000
> > 
> > Reported-by: syzbot+fd15ff734dace9e16437@syzkaller.appspotmail.com
> > Fixes: 2b0d3d3e4fcf ("percpu_ref: reduce memory footprint of percpu_ref in fast path")
> > 
> > For information about bisection process see: https://goo.gl/tpsmEJ#bisection
> 
> Ming, this looks like a call of percpu_ref_exit() on a zeroed refs (that
> hasn't been initialized). Really a caller error imho, but might make sense
> to be a bit safer there.

Hello Jens,

The fix is sent out as:

https://lore.kernel.org/linux-block/20201009040356.43802-1-ming.lei@redhat.com/T/#u

Sorry for making the trouble.

Thanks,
Ming


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

end of thread, other threads:[~2020-10-09  4:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-08 15:09 general protection fault in percpu_ref_exit syzbot
2020-10-08 20:28 ` syzbot
2020-10-09  1:23   ` Jens Axboe
2020-10-09  4:05     ` Ming Lei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).