BUG: unable to handle kernel paging request in slhc_free

34 views
Skip to first unread message

syzbot

unread,
Dec 28, 2018, 9:41:05 PM12/28/18
to da...@davemloft.net, linux-...@vger.kernel.org, net...@vger.kernel.org, syzkall...@googlegroups.com, teja...@codeaurora.org
Hello,

syzbot found the following crash on:

HEAD commit: 8fe28cb58bcb Linux 4.20
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16771b15400000
kernel config: https://syzkaller.appspot.com/x/.config?x=7d581260bae0899a
dashboard link: https://syzkaller.appspot.com/bug?extid=6c5d567447bfa30f78e2
compiler: gcc (GCC) 8.0.1 20180413 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=136130fd400000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1607c563400000

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

RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000440359
RDX: 0000000020000080 RSI: 0000000000005423 RDI: 0000000000000003
RBP: 00000000006cb018 R08: 0000000000000001 R09: 0000000000000039
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000004
R13: ffffffffffffffff R14: 0000000000000000 R15: 0000000000000000
BUG: unable to handle kernel paging request at fffffffffffffff4
PGD 946d067 P4D 946d067 PUD 946f067 PMD 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 8225 Comm: syz-executor096 Not tainted 4.20.0 #167
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:slhc_free+0x30/0xb0 drivers/net/slip/slhc.c:159
Code: 53 48 89 fb e8 71 04 ad fc 48 85 db 74 74 e8 67 04 ad fc 48 89 da 48
b8 00 00 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 75 69 <4c> 8b 23 4d 85
e4 74 0d e8 43 04 ad fc 4c 89 e7 e8 bb e1 ef fc e8
RSP: 0018:ffff8881c1a0f770 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: fffffffffffffff4 RCX: 1ffff1103408b936
RDX: 1ffffffffffffffe RSI: ffffffff84d15439 RDI: fffffffffffffff4
RBP: ffff8881c1a0f780 R08: ffff8881a045c9b0 R09: 0000000000000006
R10: 0000000000000000 R11: ffff8881a045c0c0 R12: 00000000ffffff97
R13: ffff8881c0ca04c0 R14: ffff8881c0daed00 R15: ffff8881c2152ac0
FS: 000000000078a880(0000) GS:ffff8881daf00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: fffffffffffffff4 CR3: 00000001b0909000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
sl_alloc_bufs drivers/net/slip/slip.c:196 [inline]
slip_open+0xdee/0x1107 drivers/net/slip/slip.c:821
tty_ldisc_open.isra.1+0x8b/0xe0 drivers/tty/tty_ldisc.c:453
tty_set_ldisc+0x2dc/0x6a0 drivers/tty/tty_ldisc.c:578
tiocsetd drivers/tty/tty_io.c:2321 [inline]
tty_ioctl+0x39d/0x17d0 drivers/tty/tty_io.c:2581
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:509 [inline]
do_vfs_ioctl+0x1de/0x1790 fs/ioctl.c:696
ksys_ioctl+0xa9/0xd0 fs/ioctl.c:713
__do_sys_ioctl fs/ioctl.c:720 [inline]
__se_sys_ioctl fs/ioctl.c:718 [inline]
__x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718
do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440359
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:00007fff63454bb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000440359
RDX: 0000000020000080 RSI: 0000000000005423 RDI: 0000000000000003
RBP: 00000000006cb018 R08: 0000000000000001 R09: 0000000000000039
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000004
R13: ffffffffffffffff R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
CR2: fffffffffffffff4
---[ end trace 45b654871fafdc18 ]---
RIP: 0010:slhc_free+0x30/0xb0 drivers/net/slip/slhc.c:159
Code: 53 48 89 fb e8 71 04 ad fc 48 85 db 74 74 e8 67 04 ad fc 48 89 da 48
b8 00 00 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 75 69 <4c> 8b 23 4d 85
e4 74 0d e8 43 04 ad fc 4c 89 e7 e8 bb e1 ef fc e8
RSP: 0018:ffff8881c1a0f770 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: fffffffffffffff4 RCX: 1ffff1103408b936
RDX: 1ffffffffffffffe RSI: ffffffff84d15439 RDI: fffffffffffffff4
RBP: ffff8881c1a0f780 R08: ffff8881a045c9b0 R09: 0000000000000006
R10: 0000000000000000 R11: ffff8881a045c0c0 R12: 00000000ffffff97
R13: ffff8881c0ca04c0 R14: ffff8881c0daed00 R15: ffff8881c2152ac0
FS: 000000000078a880(0000) GS:ffff8881daf00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: fffffffffffffff4 CR3: 00000001b0909000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
This bug 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 syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with
syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Mar 16, 2019, 10:49:02 AM3/16/19
to akinob...@gmail.com, ak...@linux-foundation.org, da...@davemloft.net, dvy...@google.com, linux-...@vger.kernel.org, mho...@kernel.org, net...@vger.kernel.org, syzkall...@googlegroups.com, teja...@codeaurora.org, torv...@linux-foundation.org
syzbot has bisected this bug to:

commit e41d58185f1444368873d4d7422f7664a68be61d
Author: Dmitry Vyukov <dvy...@google.com>
Date: Wed Jul 12 21:34:35 2017 +0000

fault-inject: support systematic fault injection

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1415a8a3200000
start commit: e41d5818 fault-inject: support systematic fault injection
git tree: upstream
final crash: https://syzkaller.appspot.com/x/report.txt?x=1615a8a3200000
console output: https://syzkaller.appspot.com/x/log.txt?x=1215a8a3200000
Reported-by: syzbot+6c5d56...@syzkaller.appspotmail.com
Fixes: e41d5818 ("fault-inject: support systematic fault injection")

Linus Torvalds

unread,
Mar 16, 2019, 1:24:28 PM3/16/19
to syzbot, David Miller, Linux List Kernel Mailing, Netdev, syzkall...@googlegroups.com, teja...@codeaurora.org
On Fri, Dec 28, 2018 at 6:41 PM syzbot
<syzbot+6c5d56...@syzkaller.appspotmail.com> wrote:
>
> Reported-by: syzbot+6c5d56...@syzkaller.appspotmail.com
>
> BUG: unable to handle kernel paging request at fffffffffffffff4
> RIP: slhc_free+0x30/0xb0 drivers/net/slip/slhc.c:159
> Call Trace:
> sl_alloc_bufs drivers/net/slip/slip.c:196 [inline]
> slip_open+0xdee/0x1107 drivers/net/slip/slip.c:821

The error handling in sl_alloc_bufs() is broken.

It does

slcomp = slhc_init(16, 16);
if (IS_ERR(slcomp))
goto err_exit;

and knows that the error case returns an error pointer, but then the
'err_exit:' code just does

slhc_free(slcomp);

which doesn't handle error pointers.

The slhc code in general is pretty odd, presumably for some legacy
reason. It does things like

if ( comp == NULLSLCOMPR )
return;

to compare against NULL. That's some crazy stuff.

I don't think anybody really wants to bother with slip any more, and
the simplest fix seems to just be to let slhc_free() handle all the
error pointers that slhc_init() can return, and do something like
this:

drivers/net/slip/slhc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/slip/slhc.c b/drivers/net/slip/slhc.c
index f4e93f5fc204..3ee19a5b03a1 100644
--- a/drivers/net/slip/slhc.c
+++ b/drivers/net/slip/slhc.c
@@ -153,7 +153,7 @@ slhc_init(int rslots, int tslots)
void
slhc_free(struct slcompress *comp)
{
- if ( comp == NULLSLCOMPR )
+ if (IS_ERR_OR_NULL(comp))
return;

if ( comp->tstate != NULLSLSTATE )

which is obviously and intentionally whitespace-damaged, but you get the idea.

David?

Linus

syzbot

unread,
Nov 16, 2019, 12:42:02 PM11/16/19
to akinob...@gmail.com, ak...@linux-foundation.org, da...@davemloft.net, dvy...@google.com, linux-...@vger.kernel.org, mho...@kernel.org, net...@vger.kernel.org, syzkall...@googlegroups.com, teja...@codeaurora.org, torv...@linux-foundation.org
syzbot has bisected this bug to:

commit e41d58185f1444368873d4d7422f7664a68be61d
Author: Dmitry Vyukov <dvy...@google.com>
Date: Wed Jul 12 21:34:35 2017 +0000

fault-inject: support systematic fault injection

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=144b8772e00000
start commit: 8fe28cb5 Linux 4.20
git tree: upstream
final crash: https://syzkaller.appspot.com/x/report.txt?x=164b8772e00000
console output: https://syzkaller.appspot.com/x/log.txt?x=124b8772e00000
Reported-by: syzbot+6c5d56...@syzkaller.appspotmail.com
Fixes: e41d58185f14 ("fault-inject: support systematic fault injection")

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

syzbot

unread,
Dec 5, 2019, 3:26:01 PM12/5/19
to adob...@gmail.com, akinob...@gmail.com, ak...@linux-foundation.org, b...@decadent.org.uk, da...@davemloft.net, dvy...@google.com, linux-...@vger.kernel.org, mho...@kernel.org, net...@vger.kernel.org, syzkall...@googlegroups.com, teja...@codeaurora.org, torv...@linux-foundation.org
syzbot suspects this bug was fixed by commit:

commit baf76f0c58aec435a3a864075b8f6d8ee5d1f17e
Author: Linus Torvalds <torv...@linux-foundation.org>
Date: Thu Apr 25 23:13:58 2019 +0000

slip: make slhc_free() silently accept an error pointer

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=114af97ee00000
start commit: 8fe28cb5 Linux 4.20
git tree: upstream
If the result looks correct, please mark the bug fixed by replying with:

#syz fix: slip: make slhc_free() silently accept an error pointer

Eric Biggers

unread,
Mar 7, 2020, 3:58:08 PM3/7/20
to syzbot, syzkall...@googlegroups.com
On Thu, Dec 05, 2019 at 12:26:00PM -0800, syzbot wrote:
> syzbot suspects this bug was fixed by commit:
>
> commit baf76f0c58aec435a3a864075b8f6d8ee5d1f17e
> Author: Linus Torvalds <torv...@linux-foundation.org>
> Date: Thu Apr 25 23:13:58 2019 +0000
>
> slip: make slhc_free() silently accept an error pointer

Reply all
Reply to author
Forward
0 new messages