Re: general protection fault in xsk_map_update_elem

2019-09-23 Thread Björn Töpel

On 2019-09-24 00:50, Daniel Borkmann wrote:

On Mon, Sep 23, 2019 at 08:49:11AM -0700, syzbot wrote:

Hello,

syzbot found the following crash on:

HEAD commit:b41dae06 Merge tag 'xfs-5.4-merge-7' of git://git.kernel.o..
git tree:   net-next
console output: https://syzkaller.appspot.com/x/log.txt?x=130b25ad60
kernel config:  https://syzkaller.appspot.com/x/.config?x=dfcf592db22b9132
dashboard link: https://syzkaller.appspot.com/bug?extid=491c1b7565ba9069ecae
compiler:   gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=155a0c2960
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=172bf6d960

The bug was bisected to:

commit 0402acd683c678874df6bdbc23530ca07ea19353
Author: Björn Töpel 
Date:   Thu Aug 15 09:30:13 2019 +

 xsk: remove AF_XDP socket from map when the socket is released


Bjorn, PTAL, thanks.



I'm on it! Thanks for the poke.


Re: general protection fault in xsk_map_update_elem

2019-09-23 Thread Daniel Borkmann
On Mon, Sep 23, 2019 at 08:49:11AM -0700, syzbot wrote:
> Hello,
> 
> syzbot found the following crash on:
> 
> HEAD commit:b41dae06 Merge tag 'xfs-5.4-merge-7' of git://git.kernel.o..
> git tree:   net-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=130b25ad60
> kernel config:  https://syzkaller.appspot.com/x/.config?x=dfcf592db22b9132
> dashboard link: https://syzkaller.appspot.com/bug?extid=491c1b7565ba9069ecae
> compiler:   gcc (GCC) 9.0.0 20181231 (experimental)
> syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=155a0c2960
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=172bf6d960
> 
> The bug was bisected to:
> 
> commit 0402acd683c678874df6bdbc23530ca07ea19353
> Author: Björn Töpel 
> Date:   Thu Aug 15 09:30:13 2019 +
> 
> xsk: remove AF_XDP socket from map when the socket is released

Bjorn, PTAL, thanks.


general protection fault in xsk_map_update_elem

2019-09-23 Thread syzbot

Hello,

syzbot found the following crash on:

HEAD commit:b41dae06 Merge tag 'xfs-5.4-merge-7' of git://git.kernel.o..
git tree:   net-next
console output: https://syzkaller.appspot.com/x/log.txt?x=130b25ad60
kernel config:  https://syzkaller.appspot.com/x/.config?x=dfcf592db22b9132
dashboard link: https://syzkaller.appspot.com/bug?extid=491c1b7565ba9069ecae
compiler:   gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=155a0c2960
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=172bf6d960

The bug was bisected to:

commit 0402acd683c678874df6bdbc23530ca07ea19353
Author: Björn Töpel 
Date:   Thu Aug 15 09:30:13 2019 +

xsk: remove AF_XDP socket from map when the socket is released

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=10d4a82360
final crash:https://syzkaller.appspot.com/x/report.txt?x=12d4a82360
console output: https://syzkaller.appspot.com/x/log.txt?x=14d4a82360

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+491c1b7565ba9069e...@syzkaller.appspotmail.com
Fixes: 0402acd683c6 ("xsk: remove AF_XDP socket from map when the socket is  
released")


RDX: 0020 RSI: 2100 RDI: 0002
RBP: 0005 R08: 0001 R09: 7ffef4500033
R10:  R11: 0246 R12: 00401ff0
R13: 00402080 R14:  R15: 
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault:  [#1] PREEMPT SMP KASAN
CPU: 1 PID: 8878 Comm: syz-executor835 Not tainted 5.3.0+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011

RIP: 0010:__list_add include/linux/list.h:64 [inline]
RIP: 0010:list_add_tail include/linux/list.h:93 [inline]
RIP: 0010:xsk_map_sock_add kernel/bpf/xskmap.c:62 [inline]
RIP: 0010:xsk_map_update_elem+0x79c/0xac0 kernel/bpf/xskmap.c:265
Code: 00 fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 ef 02 00 00 4c 89 e2 4d 89  
a7 d8 05 00 00 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f  
85 c0 02 00 00 49 8d 7c 24 08 49 8d 87 d0 05 00 00

RSP: 0018:88809a517bb8 EFLAGS: 00010246
RAX: dc00 RBX: 88809ccc49d0 RCX: 81868070
RDX:  RSI: 81868085 RDI: 0001
RBP: 88809a517c78 R08: 8880a10d2000 R09: ed10134a2f65
R10: ed10134a2f64 R11: 0003 R12: 
R13: 88809ccc49e0 R14: 888089db5580 R15: 88809ccc4400
FS:  55df2880() GS:8880ae90() knlGS:
CS:  0010 DS:  ES:  CR0: 80050033
CR2: 2040 CR3: 985e5000 CR4: 001406e0
DR0:  DR1:  DR2: 
DR3:  DR6: fffe0ff0 DR7: 0400
Call Trace:
 map_update_elem+0xc82/0x10b0 kernel/bpf/syscall.c:966
 __do_sys_bpf+0x8b5/0x3350 kernel/bpf/syscall.c:2854
 __se_sys_bpf kernel/bpf/syscall.c:2825 [inline]
 __x64_sys_bpf+0x73/0xb0 kernel/bpf/syscall.c:2825
 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440709
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 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 5b 14 fc ff c3 66 2e 0f 1f 84 00 00 00 00

RSP: 002b:7ffef4503478 EFLAGS: 0246 ORIG_RAX: 0141
RAX: ffda RBX: 7ffef4503480 RCX: 00440709
RDX: 0020 RSI: 2100 RDI: 0002
RBP: 0005 R08: 0001 R09: 7ffef4500033
R10:  R11: 0246 R12: 00401ff0
R13: 00402080 R14:  R15: 
Modules linked in:
---[ end trace a95b9b926f856077 ]---
RIP: 0010:__list_add include/linux/list.h:64 [inline]
RIP: 0010:list_add_tail include/linux/list.h:93 [inline]
RIP: 0010:xsk_map_sock_add kernel/bpf/xskmap.c:62 [inline]
RIP: 0010:xsk_map_update_elem+0x79c/0xac0 kernel/bpf/xskmap.c:265
Code: 00 fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 ef 02 00 00 4c 89 e2 4d 89  
a7 d8 05 00 00 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f  
85 c0 02 00 00 49 8d 7c 24 08 49 8d 87 d0 05 00 00

RSP: 0018:88809a517bb8 EFLAGS: 00010246
RAX: dc00 RBX: 88809ccc49d0 RCX: 81868070
RDX:  RSI: 81868085 RDI: 0001
RBP: 88809a517c78 R08: 8880a10d2000 R09: ed10134a2f65
R10: ed10134a2f64 R11: 0003 R12: 
R13: 88809ccc49e0 R14: 888089db5580 R15: 88809ccc4400
FS:  55df2880() GS:8880ae90() knlGS:
CS:  0010 DS:  ES:  CR0: 80050033
CR2: 2040 CR3: 985e5000 CR4: 001406e0
DR0:  DR1: