sunrpc: infinite unkillable console spam in xs_tcp_setup_socket

790 views
Skip to first unread message

Dmitry Vyukov

unread,
Nov 20, 2017, 8:02:51 AM11/20/17
to Bruce Fields, jla...@kernel.org, trond.m...@primarydata.com, anna.sc...@netapp.com, David Miller, linu...@vger.kernel.org, netdev, LKML, syzkaller
Hello,

The following program triggers infinite stream of the following output
on console. The program is unkillable and this effectively brings the
machine down:


** 16 printk messages dropped ** [12875.022917] xs_tcp_setup_socket:
connect returned unhandled error -113
** 17 printk messages dropped ** [12875.024832] xs_tcp_setup_socket:
connect returned unhandled error -113
** 17 printk messages dropped ** [12875.026765] xs_tcp_setup_socket:
connect returned unhandled error -113
** 17 printk messages dropped ** [12875.028729] xs_tcp_setup_socket:
connect returned unhandled error -113
** 17 printk messages dropped ** [12875.030648] xs_tcp_setup_socket:
connect returned unhandled error -113
** 15 printk messages dropped ** [12875.032360] xs_tcp_setup_socket:
connect returned unhandled error -113
** 16 printk messages dropped ** [12875.034197] xs_tcp_setup_socket:
connect returned unhandled error -113
** 16 printk messages dropped ** [12875.035988] xs_tcp_setup_socket:
connect returned unhandled error -113
** 15 printk messages dropped ** [12875.037718] xs_tcp_setup_socket:
connect returned unhandled error -113
** 16 printk messages dropped ** [12875.039553] xs_tcp_setup_socket:
connect returned unhandled error -113
** 16 printk messages dropped ** [12875.041392] xs_tcp_setup_socket:
connect returned unhandled error -113


Program:
https://gist.github.com/dvyukov/629543c9abc19576fec66ce8fae130c7

On upstream commit c8a0739b185d11d6e2ca7ad9f5835841d1cfc765 (Nov 19).
Config is attached.

Found by syzkaller fuzzer.

Thanks.
.config

Trond Myklebust

unread,
Nov 24, 2017, 12:34:10 PM11/24/17
to linux-...@vger.kernel.org, jla...@kernel.org, bfi...@fieldses.org, linu...@vger.kernel.org, dvy...@google.com, anna.sc...@netapp.com, net...@vger.kernel.org, da...@davemloft.net, syzk...@googlegroups.com
On Mon, 2017-11-20 at 14:02 +0100, Dmitry Vyukov wrote:
> Hello,
>
> The following program triggers infinite stream of the following
> output
> on console. The program is unkillable and this effectively brings the
> machine down:
>
>
> ** 16 printk messages dropped ** [12875.022917] xs_tcp_setup_socket:
> connect returned unhandled error -113
>

Does the following fix the issue?

8<-----------------------------------------------------
From f48d3f01df45f50f0145060f5272ccf1aea855ac Mon Sep 17 00:00:00 2001
From: Trond Myklebust <trond.m...@primarydata.com>
Date: Fri, 24 Nov 2017 12:00:24 -0500
Subject: [PATCH] SUNRPC: Allow connect to return EHOSTUNREACH

Reported-by: Dmitry Vyukov <dvy...@google.com>
Signed-off-by: Trond Myklebust <trond.m...@primarydata.com>
---
net/sunrpc/xprtsock.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 4dad5da388d6..8cb40f8ffa5b 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2437,6 +2437,7 @@ static void xs_tcp_setup_socket(struct work_struct *work)
case -ECONNREFUSED:
case -ECONNRESET:
case -ENETUNREACH:
+ case -EHOSTUNREACH:
case -EADDRINUSE:
case -ENOBUFS:
/*
--
2.14.3

--
Trond Myklebust
Linux NFS client maintainer, PrimaryData
trond.m...@primarydata.com

Dmitry Vyukov

unread,
Nov 28, 2017, 5:01:17 AM11/28/17
to Trond Myklebust, linux-...@vger.kernel.org, jla...@kernel.org, bfi...@fieldses.org, linu...@vger.kernel.org, anna.sc...@netapp.com, net...@vger.kernel.org, da...@davemloft.net, syzk...@googlegroups.com
On Fri, Nov 24, 2017 at 6:34 PM, Trond Myklebust
<tro...@primarydata.com> wrote:
> On Mon, 2017-11-20 at 14:02 +0100, Dmitry Vyukov wrote:
>> Hello,
>>
>> The following program triggers infinite stream of the following
>> output
>> on console. The program is unkillable and this effectively brings the
>> machine down:
>>
>>
>> ** 16 printk messages dropped ** [12875.022917] xs_tcp_setup_socket:
>> connect returned unhandled error -113
>>
>
> Does the following fix the issue?


Re-run the provided reproducer with the patch.
I don't see any kernel output and the process is perfectly killable now.

Tested-by: Dmitry Vyukov <dvy...@google.com>
Reply all
Reply to author
Forward
0 new messages