All of lore.kernel.org
 help / color / mirror / Atom feed
* [syzbot] KASAN: vmalloc-out-of-bounds Write in ringbuf_map_alloc
@ 2022-02-01  5:40 syzbot
  2022-02-02 12:11 ` syzbot
  2022-02-02 14:36 ` syzbot
  0 siblings, 2 replies; 7+ messages in thread
From: syzbot @ 2022-02-01  5:40 UTC (permalink / raw)
  To: andrii, ast, bpf, daniel, john.fastabend, kafai, kpsingh,
	linux-kernel, netdev, songliubraving, syzkaller-bugs, yhs

Hello,

syzbot found the following issue on:

HEAD commit:    887a333c44eb Add linux-next specific files for 20220131
git tree:       linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=106ea200700000
kernel config:  https://syzkaller.appspot.com/x/.config?x=a9a7db1ff785d5c0
dashboard link: https://syzkaller.appspot.com/bug?extid=5ad567a418794b9b5983
compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2

Unfortunately, I don't have any reproducer for this issue yet.

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

==================================================================
BUG: KASAN: vmalloc-out-of-bounds in bpf_ringbuf_area_alloc kernel/bpf/ringbuf.c:110 [inline]
BUG: KASAN: vmalloc-out-of-bounds in bpf_ringbuf_alloc kernel/bpf/ringbuf.c:133 [inline]
BUG: KASAN: vmalloc-out-of-bounds in ringbuf_map_alloc kernel/bpf/ringbuf.c:172 [inline]
BUG: KASAN: vmalloc-out-of-bounds in ringbuf_map_alloc+0x725/0x7b0 kernel/bpf/ringbuf.c:148
Write of size 8 at addr ffffc9001653a078 by task syz-executor.2/9141

CPU: 0 PID: 9141 Comm: syz-executor.2 Not tainted 5.17.0-rc2-next-20220131-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_address_description.constprop.0.cold+0xf/0x3e0 mm/kasan/report.c:255
 __kasan_report mm/kasan/report.c:442 [inline]
 kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
 bpf_ringbuf_area_alloc kernel/bpf/ringbuf.c:110 [inline]
 bpf_ringbuf_alloc kernel/bpf/ringbuf.c:133 [inline]
 ringbuf_map_alloc kernel/bpf/ringbuf.c:172 [inline]
 ringbuf_map_alloc+0x725/0x7b0 kernel/bpf/ringbuf.c:148
 find_and_alloc_map kernel/bpf/syscall.c:128 [inline]
 map_create kernel/bpf/syscall.c:863 [inline]
 __sys_bpf+0xc0f/0x5f10 kernel/bpf/syscall.c:4622
 __do_sys_bpf kernel/bpf/syscall.c:4744 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:4742 [inline]
 __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:4742
 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+0x44/0xae
RIP: 0033:0x7fab8b037059
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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fab89fac168 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007fab8b149f60 RCX: 00007fab8b037059
RDX: 0000000000000048 RSI: 0000000020000440 RDI: 0000000000000000
RBP: 00007fab8b09108d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff1a45415f R14: 00007fab89fac300 R15: 0000000000022000
 </TASK>


Memory state around the buggy address:
 ffffc90016539f00: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffffc90016539f80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
>ffffc9001653a000: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
                                                                ^
 ffffc9001653a080: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffffc9001653a100: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
==================================================================


---
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.

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

* Re: [syzbot] KASAN: vmalloc-out-of-bounds Write in ringbuf_map_alloc
  2022-02-01  5:40 [syzbot] KASAN: vmalloc-out-of-bounds Write in ringbuf_map_alloc syzbot
@ 2022-02-02 12:11 ` syzbot
  2022-02-02 12:20   ` Daniel Borkmann
  2022-02-02 14:36 ` syzbot
  1 sibling, 1 reply; 7+ messages in thread
From: syzbot @ 2022-02-02 12:11 UTC (permalink / raw)
  To: andrii, ast, bpf, daniel, davem, hotforest, houtao1,
	john.fastabend, kafai, kpsingh, kuba, linux-kernel, netdev,
	songliubraving, syzkaller-bugs, yhs

syzbot has found a reproducer for the following issue on:

HEAD commit:    6abab1b81b65 Add linux-next specific files for 20220202
git tree:       linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=13f4b900700000
kernel config:  https://syzkaller.appspot.com/x/.config?x=b8d8750556896349
dashboard link: https://syzkaller.appspot.com/bug?extid=5ad567a418794b9b5983
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=1450d9f0700000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=130ef35bb00000

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

==================================================================
BUG: KASAN: vmalloc-out-of-bounds in bpf_ringbuf_area_alloc kernel/bpf/ringbuf.c:110 [inline]
BUG: KASAN: vmalloc-out-of-bounds in bpf_ringbuf_alloc kernel/bpf/ringbuf.c:133 [inline]
BUG: KASAN: vmalloc-out-of-bounds in ringbuf_map_alloc kernel/bpf/ringbuf.c:172 [inline]
BUG: KASAN: vmalloc-out-of-bounds in ringbuf_map_alloc+0x725/0x7b0 kernel/bpf/ringbuf.c:148
Write of size 8 at addr ffffc9000c7a9078 by task syz-executor070/3595

CPU: 0 PID: 3595 Comm: syz-executor070 Not tainted 5.17.0-rc2-next-20220202-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_address_description.constprop.0.cold+0xf/0x3e0 mm/kasan/report.c:255
 __kasan_report mm/kasan/report.c:442 [inline]
 kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
 bpf_ringbuf_area_alloc kernel/bpf/ringbuf.c:110 [inline]
 bpf_ringbuf_alloc kernel/bpf/ringbuf.c:133 [inline]
 ringbuf_map_alloc kernel/bpf/ringbuf.c:172 [inline]
 ringbuf_map_alloc+0x725/0x7b0 kernel/bpf/ringbuf.c:148
 find_and_alloc_map kernel/bpf/syscall.c:128 [inline]
 map_create kernel/bpf/syscall.c:863 [inline]
 __sys_bpf+0xc0f/0x5f10 kernel/bpf/syscall.c:4622
 __do_sys_bpf kernel/bpf/syscall.c:4744 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:4742 [inline]
 __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:4742
 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+0x44/0xae
RIP: 0033:0x7f26ddd0a029
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:00007fff911fde88 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f26ddd0a029
RDX: 0000000000000048 RSI: 0000000020000280 RDI: 0000000000000000
RBP: 00007f26ddcce010 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 00007f26ddcce0a0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>


Memory state around the buggy address:
 ffffc9000c7a8f00: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffffc9000c7a8f80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
>ffffc9000c7a9000: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
                                                                ^
 ffffc9000c7a9080: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffffc9000c7a9100: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
==================================================================


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

* Re: [syzbot] KASAN: vmalloc-out-of-bounds Write in ringbuf_map_alloc
  2022-02-02 12:11 ` syzbot
@ 2022-02-02 12:20   ` Daniel Borkmann
  2022-02-02 14:49     ` syzbot
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Borkmann @ 2022-02-02 12:20 UTC (permalink / raw)
  To: syzbot, andrii, ast, bpf, davem, hotforest, houtao1,
	john.fastabend, kafai, kpsingh, kuba, linux-kernel, netdev,
	songliubraving, syzkaller-bugs, yhs

On 2/2/22 1:11 PM, syzbot wrote:
> syzbot has found a reproducer for the following issue on:
> 
> HEAD commit:    6abab1b81b65 Add linux-next specific files for 20220202
> git tree:       linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=13f4b900700000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=b8d8750556896349
> dashboard link: https://syzkaller.appspot.com/bug?extid=5ad567a418794b9b5983
> 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=1450d9f0700000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=130ef35bb00000
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+5ad567a418794b9b5983@syzkaller.appspotmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/dborkman/bpf.git pr/rb-vmap

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

* Re: [syzbot] KASAN: vmalloc-out-of-bounds Write in ringbuf_map_alloc
  2022-02-01  5:40 [syzbot] KASAN: vmalloc-out-of-bounds Write in ringbuf_map_alloc syzbot
  2022-02-02 12:11 ` syzbot
@ 2022-02-02 14:36 ` syzbot
  2022-02-02 14:49   ` Marco Elver
  1 sibling, 1 reply; 7+ messages in thread
From: syzbot @ 2022-02-02 14:36 UTC (permalink / raw)
  To: akpm, andreyknvl, andrii, ast, bpf, daniel, davem, elver, glider,
	hotforest, houtao1, john.fastabend, kafai, kpsingh, kuba,
	linux-kernel, netdev, sfr, songliubraving, syzkaller-bugs, yhs

syzbot has bisected this issue to:

commit c34cdf846c1298de1c0f7fbe04820fe96c45068c
Author: Andrey Konovalov <andreyknvl@google.com>
Date:   Wed Feb 2 01:04:27 2022 +0000

    kasan, vmalloc: unpoison VM_ALLOC pages after mapping

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=128cb900700000
start commit:   6abab1b81b65 Add linux-next specific files for 20220202
git tree:       linux-next
final oops:     https://syzkaller.appspot.com/x/report.txt?x=118cb900700000
console output: https://syzkaller.appspot.com/x/log.txt?x=168cb900700000
kernel config:  https://syzkaller.appspot.com/x/.config?x=b8d8750556896349
dashboard link: https://syzkaller.appspot.com/bug?extid=5ad567a418794b9b5983
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1450d9f0700000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=130ef35bb00000

Reported-by: syzbot+5ad567a418794b9b5983@syzkaller.appspotmail.com
Fixes: c34cdf846c12 ("kasan, vmalloc: unpoison VM_ALLOC pages after mapping")

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

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

* Re: [syzbot] KASAN: vmalloc-out-of-bounds Write in ringbuf_map_alloc
  2022-02-02 12:20   ` Daniel Borkmann
@ 2022-02-02 14:49     ` syzbot
  0 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2022-02-02 14:49 UTC (permalink / raw)
  To: andrii, ast, bpf, daniel, davem, hotforest, houtao1,
	john.fastabend, kafai, kpsingh, kuba, linux-kernel, netdev,
	songliubraving, syzkaller-bugs, yhs

Hello,

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

Reported-and-tested-by: syzbot+5ad567a418794b9b5983@syzkaller.appspotmail.com

Tested on:

commit:         48f52cba bpf: use VM_MAP instead of VM_ALLOC for ringbuf
git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/dborkman/bpf.git pr/rb-vmap
kernel config:  https://syzkaller.appspot.com/x/.config?x=5044676c290190f2
dashboard link: https://syzkaller.appspot.com/bug?extid=5ad567a418794b9b5983
compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2

Note: testing is done by a robot and is best-effort only.

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

* Re: [syzbot] KASAN: vmalloc-out-of-bounds Write in ringbuf_map_alloc
  2022-02-02 14:36 ` syzbot
@ 2022-02-02 14:49   ` Marco Elver
  2022-02-02 14:55     ` Daniel Borkmann
  0 siblings, 1 reply; 7+ messages in thread
From: Marco Elver @ 2022-02-02 14:49 UTC (permalink / raw)
  To: syzbot
  Cc: akpm, andreyknvl, andrii, ast, bpf, daniel, davem, glider,
	hotforest, houtao1, john.fastabend, kafai, kpsingh, kuba,
	linux-kernel, netdev, sfr, songliubraving, syzkaller-bugs, yhs

On Wed, 2 Feb 2022 at 15:36, syzbot
<syzbot+5ad567a418794b9b5983@syzkaller.appspotmail.com> wrote:
>
> syzbot has bisected this issue to:
>
> commit c34cdf846c1298de1c0f7fbe04820fe96c45068c
> Author: Andrey Konovalov <andreyknvl@google.com>
> Date:   Wed Feb 2 01:04:27 2022 +0000
>
>     kasan, vmalloc: unpoison VM_ALLOC pages after mapping

Is this a case of a new bug surfacing due to KASAN improvements? But
it's not quite clear to me why this commit.

Andrey, any thoughts?

> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=128cb900700000
> start commit:   6abab1b81b65 Add linux-next specific files for 20220202
> git tree:       linux-next
> final oops:     https://syzkaller.appspot.com/x/report.txt?x=118cb900700000
> console output: https://syzkaller.appspot.com/x/log.txt?x=168cb900700000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=b8d8750556896349
> dashboard link: https://syzkaller.appspot.com/bug?extid=5ad567a418794b9b5983
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1450d9f0700000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=130ef35bb00000
>
> Reported-by: syzbot+5ad567a418794b9b5983@syzkaller.appspotmail.com
> Fixes: c34cdf846c12 ("kasan, vmalloc: unpoison VM_ALLOC pages after mapping")
>
> For information about bisection process see: https://goo.gl/tpsmEJ#bisection

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

* Re: [syzbot] KASAN: vmalloc-out-of-bounds Write in ringbuf_map_alloc
  2022-02-02 14:49   ` Marco Elver
@ 2022-02-02 14:55     ` Daniel Borkmann
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Borkmann @ 2022-02-02 14:55 UTC (permalink / raw)
  To: Marco Elver, syzbot
  Cc: akpm, andreyknvl, andrii, ast, bpf, davem, glider, hotforest,
	houtao1, john.fastabend, kafai, kpsingh, kuba, linux-kernel,
	netdev, sfr, songliubraving, syzkaller-bugs, yhs

On 2/2/22 3:49 PM, Marco Elver wrote:
> On Wed, 2 Feb 2022 at 15:36, syzbot
> <syzbot+5ad567a418794b9b5983@syzkaller.appspotmail.com> wrote:
>>
>> syzbot has bisected this issue to:
>>
>> commit c34cdf846c1298de1c0f7fbe04820fe96c45068c
>> Author: Andrey Konovalov <andreyknvl@google.com>
>> Date:   Wed Feb 2 01:04:27 2022 +0000
>>
>>      kasan, vmalloc: unpoison VM_ALLOC pages after mapping
> 
> Is this a case of a new bug surfacing due to KASAN improvements? But
> it's not quite clear to me why this commit.
> 
> Andrey, any thoughts?

Marco / Andrey, fix should be this one:

https://patchwork.kernel.org/project/netdevbpf/patch/20220202060158.6260-1-houtao1@huawei.com/

>> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=128cb900700000
>> start commit:   6abab1b81b65 Add linux-next specific files for 20220202
>> git tree:       linux-next
>> final oops:     https://syzkaller.appspot.com/x/report.txt?x=118cb900700000
>> console output: https://syzkaller.appspot.com/x/log.txt?x=168cb900700000
>> kernel config:  https://syzkaller.appspot.com/x/.config?x=b8d8750556896349
>> dashboard link: https://syzkaller.appspot.com/bug?extid=5ad567a418794b9b5983
>> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1450d9f0700000
>> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=130ef35bb00000
>>
>> Reported-by: syzbot+5ad567a418794b9b5983@syzkaller.appspotmail.com
>> Fixes: c34cdf846c12 ("kasan, vmalloc: unpoison VM_ALLOC pages after mapping")
>>
>> For information about bisection process see: https://goo.gl/tpsmEJ#bisection


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

end of thread, other threads:[~2022-02-02 14:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-01  5:40 [syzbot] KASAN: vmalloc-out-of-bounds Write in ringbuf_map_alloc syzbot
2022-02-02 12:11 ` syzbot
2022-02-02 12:20   ` Daniel Borkmann
2022-02-02 14:49     ` syzbot
2022-02-02 14:36 ` syzbot
2022-02-02 14:49   ` Marco Elver
2022-02-02 14:55     ` Daniel Borkmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.