From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S940599AbcJXNlk (ORCPT ); Mon, 24 Oct 2016 09:41:40 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:33787 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934946AbcJXNlh (ORCPT ); Mon, 24 Oct 2016 09:41:37 -0400 MIME-Version: 1.0 In-Reply-To: <1477313555.7065.105.camel@edumazet-glaptop3.roam.corp.google.com> References: <1477313260.7065.104.camel@edumazet-glaptop3.roam.corp.google.com> <1477313555.7065.105.camel@edumazet-glaptop3.roam.corp.google.com> From: Andrey Konovalov Date: Mon, 24 Oct 2016 15:41:34 +0200 Message-ID: Subject: Re: net/dccp: warning in dccp_set_state To: Eric Dumazet Cc: Gerrit Renker , "David S. Miller" , dccp@vger.kernel.org, netdev , LKML , syzkaller , Kostya Serebryany , Alexander Potapenko , Eric Dumazet , Dmitry Vyukov Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Eric, I can confirm that with your patch the warning goes away. Tested-by: Andrey Konovalov On Mon, Oct 24, 2016 at 2:52 PM, Eric Dumazet wrote: > On Mon, 2016-10-24 at 05:47 -0700, Eric Dumazet wrote: >> On Mon, 2016-10-24 at 14:23 +0200, Andrey Konovalov wrote: >> > Hi, >> > >> > I've got the following error report while running the syzkaller fuzzer: >> > >> > WARNING: CPU: 1 PID: 21072 at net/dccp/proto.c:83 dccp_set_state+0x229/0x290 >> > Kernel panic - not syncing: panic_on_warn set ... >> > >> > CPU: 1 PID: 21072 Comm: syz-executor Not tainted 4.9.0-rc1+ #293 >> > Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 >> > ffff88003d4c7738 ffffffff81b474f4 0000000000000003 dffffc0000000000 >> > ffffffff844f8b00 ffff88003d4c7804 ffff88003d4c7800 ffffffff8140c06a >> > 0000000041b58ab3 ffffffff8479ab7d ffffffff8140beae ffffffff8140cd00 >> > Call Trace: >> > [< inline >] __dump_stack lib/dump_stack.c:15 >> > [] dump_stack+0xb3/0x10f lib/dump_stack.c:51 >> > [] panic+0x1bc/0x39d kernel/panic.c:179 >> > [] __warn+0x1cc/0x1f0 kernel/panic.c:542 >> > [] warn_slowpath_null+0x2c/0x40 kernel/panic.c:585 >> > [] dccp_set_state+0x229/0x290 net/dccp/proto.c:83 >> > [] dccp_close+0x612/0xc10 net/dccp/proto.c:1016 >> > [] inet_release+0xef/0x1c0 net/ipv4/af_inet.c:415 >> > [] sock_release+0x8e/0x1d0 net/socket.c:570 >> > [] sock_close+0x16/0x20 net/socket.c:1017 >> > [] __fput+0x29d/0x720 fs/file_table.c:208 >> > [] ____fput+0x15/0x20 fs/file_table.c:244 >> > [] task_work_run+0xf8/0x170 kernel/task_work.c:116 >> > [< inline >] exit_task_work include/linux/task_work.h:21 >> > [] do_exit+0x883/0x2ac0 kernel/exit.c:828 >> > [] do_group_exit+0x10e/0x340 kernel/exit.c:931 >> > [] get_signal+0x634/0x15a0 kernel/signal.c:2307 >> > [] do_signal+0x8d/0x1a30 arch/x86/kernel/signal.c:807 >> > [] exit_to_usermode_loop+0xe5/0x130 >> > arch/x86/entry/common.c:156 >> > [< inline >] prepare_exit_to_usermode arch/x86/entry/common.c:190 >> > [] syscall_return_slowpath+0x1a8/0x1e0 >> > arch/x86/entry/common.c:259 >> > [] entry_SYSCALL_64_fastpath+0xc0/0xc2 >> > Dumping ftrace buffer: >> > (ftrace buffer empty) >> > Kernel Offset: disabled >> > >> > On commit 1a1891d762d6e64daf07b5be4817e3fbb29e3c59 (Oct 18). >> >> Not sure we we keep around DCCP. David could we kill it ? >> >> TCP seems to have an additional check, missing in DCCP. >> >> diff --git a/net/dccp/proto.c b/net/dccp/proto.c >> index 41e65804ddf5..9fe25bf63296 100644 >> --- a/net/dccp/proto.c >> +++ b/net/dccp/proto.c >> @@ -1009,6 +1009,10 @@ void dccp_close(struct sock *sk, long timeout) >> __kfree_skb(skb); >> } >> >> + /* If socket has been already reset kill it. */ >> + if (sk->sk_state == DCCP_CLOSED) >> + goto adjudge_to_death; >> + >> if (data_was_unread) { >> /* Unread data was tossed, send an appropriate Reset Code */ >> DCCP_WARN("ABORT with %u bytes unread\n", data_was_unread); >> > > The equivalent tcp fix was : > https://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?id=565b7b2d2e632b5792879c0c9cccdd9eecd31195 > > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrey Konovalov Date: Mon, 24 Oct 2016 13:41:34 +0000 Subject: Re: net/dccp: warning in dccp_set_state Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: dccp@vger.kernel.org Hi Eric, I can confirm that with your patch the warning goes away. Tested-by: Andrey Konovalov On Mon, Oct 24, 2016 at 2:52 PM, Eric Dumazet wrote: > On Mon, 2016-10-24 at 05:47 -0700, Eric Dumazet wrote: >> On Mon, 2016-10-24 at 14:23 +0200, Andrey Konovalov wrote: >> > Hi, >> > >> > I've got the following error report while running the syzkaller fuzzer: >> > >> > WARNING: CPU: 1 PID: 21072 at net/dccp/proto.c:83 dccp_set_state+0x229/0x290 >> > Kernel panic - not syncing: panic_on_warn set ... >> > >> > CPU: 1 PID: 21072 Comm: syz-executor Not tainted 4.9.0-rc1+ #293 >> > Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 >> > ffff88003d4c7738 ffffffff81b474f4 0000000000000003 dffffc0000000000 >> > ffffffff844f8b00 ffff88003d4c7804 ffff88003d4c7800 ffffffff8140c06a >> > 0000000041b58ab3 ffffffff8479ab7d ffffffff8140beae ffffffff8140cd00 >> > Call Trace: >> > [< inline >] __dump_stack lib/dump_stack.c:15 >> > [] dump_stack+0xb3/0x10f lib/dump_stack.c:51 >> > [] panic+0x1bc/0x39d kernel/panic.c:179 >> > [] __warn+0x1cc/0x1f0 kernel/panic.c:542 >> > [] warn_slowpath_null+0x2c/0x40 kernel/panic.c:585 >> > [] dccp_set_state+0x229/0x290 net/dccp/proto.c:83 >> > [] dccp_close+0x612/0xc10 net/dccp/proto.c:1016 >> > [] inet_release+0xef/0x1c0 net/ipv4/af_inet.c:415 >> > [] sock_release+0x8e/0x1d0 net/socket.c:570 >> > [] sock_close+0x16/0x20 net/socket.c:1017 >> > [] __fput+0x29d/0x720 fs/file_table.c:208 >> > [] ____fput+0x15/0x20 fs/file_table.c:244 >> > [] task_work_run+0xf8/0x170 kernel/task_work.c:116 >> > [< inline >] exit_task_work include/linux/task_work.h:21 >> > [] do_exit+0x883/0x2ac0 kernel/exit.c:828 >> > [] do_group_exit+0x10e/0x340 kernel/exit.c:931 >> > [] get_signal+0x634/0x15a0 kernel/signal.c:2307 >> > [] do_signal+0x8d/0x1a30 arch/x86/kernel/signal.c:807 >> > [] exit_to_usermode_loop+0xe5/0x130 >> > arch/x86/entry/common.c:156 >> > [< inline >] prepare_exit_to_usermode arch/x86/entry/common.c:190 >> > [] syscall_return_slowpath+0x1a8/0x1e0 >> > arch/x86/entry/common.c:259 >> > [] entry_SYSCALL_64_fastpath+0xc0/0xc2 >> > Dumping ftrace buffer: >> > (ftrace buffer empty) >> > Kernel Offset: disabled >> > >> > On commit 1a1891d762d6e64daf07b5be4817e3fbb29e3c59 (Oct 18). >> >> Not sure we we keep around DCCP. David could we kill it ? >> >> TCP seems to have an additional check, missing in DCCP. >> >> diff --git a/net/dccp/proto.c b/net/dccp/proto.c >> index 41e65804ddf5..9fe25bf63296 100644 >> --- a/net/dccp/proto.c >> +++ b/net/dccp/proto.c >> @@ -1009,6 +1009,10 @@ void dccp_close(struct sock *sk, long timeout) >> __kfree_skb(skb); >> } >> >> + /* If socket has been already reset kill it. */ >> + if (sk->sk_state = DCCP_CLOSED) >> + goto adjudge_to_death; >> + >> if (data_was_unread) { >> /* Unread data was tossed, send an appropriate Reset Code */ >> DCCP_WARN("ABORT with %u bytes unread\n", data_was_unread); >> > > The equivalent tcp fix was : > https://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?idV5b7b2d2e632b5792879c0c9cccdd9eecd31195 > >