Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1932537lqt; Sun, 21 Apr 2024 16:23:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXur/nSAAl943Ko72ig9Le1p6vpFFqcKsnKDfiqnGnrgEMe10mYb2HTw537snIPH20wSWJeaZQ/Dkkk+W3U6EK7mqF1Ntu6KFYvb+wO2w== X-Google-Smtp-Source: AGHT+IFlRe7UBoAAsppP2++wkNP6Fwp1tMdTEb0ydxdHCzmMCW5S3NzocR/0K+RtAqTp1/8FIejN X-Received: by 2002:a05:6512:3449:b0:518:b5af:5f67 with SMTP id j9-20020a056512344900b00518b5af5f67mr5071431lfr.64.1713741784365; Sun, 21 Apr 2024 16:23:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713741784; cv=pass; d=google.com; s=arc-20160816; b=JqCZY3sYWmnQBfZLAwEWnbFZIIwGXpzo1rKuKOGEg7jEcCIf21WnwtWtJe+32L9GD2 GSoEm+4ynYvDsJMXS6+9+JYGlB/dslEY5KddeX+AZx+Iy6ILLnd60mQkHy47we14rRO9 QimK3Lq0yOyBT0aSLPYhi9RDpZd7bZBGEppD3GwpR7WBjascroVhZmPRxxdV1Ot/w2N1 VjNPB2IDua9h67aiYmR6sToRuGlr8HBTnVZePy2fwPS9SbRGPsx0/PUywgtW7veonYiX /RMGNl63umPbOj1RokNGTn7a+r7N0OugUc5duYsE1X5qtKW+0AAr658BYcgZeh5WVzFq CS+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:references:in-reply-to:subject:cc:to:from :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=itTVdaSaWpVAwo/eRp+XlnufM44f07MOYwHHeFt+cBo=; fh=nl1pij7IhD/BETmTgbdYCdYM7dWZPDmZO026NkmJmVY=; b=hUdvmAZ3bXBUS7lE4gpxkVOENUUnxcwcGBXiL64gWZH5ONyWEyohWj+TYwc3AFEu69 FohlJ5tG5gvFQFdRkQy6vX2fPFpnrh7PpzINbSjX008W8peuszQwiVNi6Znz1HKgyCpL dzJOCjOPuh/1g7aBJdmDUPKBoA8c9t3q+/PejVTS5/hytJUzmXFG5mdByWPN6ErIKUaS fV6OcvH36FuwNgmBQylu/uUojCqVmbMKOJkdBtmbn1oF4/Vt33CJeYlK+AeZF52M/vM4 Parr6ztwlPxW/fYT0c35Dh6/GfewfSz0MnefR7rF4g8mbQsZ15P7a5egkOahAK8qquKx c4JQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=IjERKFur; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=IjERKFur; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-nfs+bounces-2909-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2909-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u18-20020aa7d0d2000000b0056fdeca8abesi5244405edo.317.2024.04.21.16.23.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 16:23:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-2909-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=IjERKFur; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=IjERKFur; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-nfs+bounces-2909-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2909-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E606B1F21456 for ; Sun, 21 Apr 2024 23:23:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8ECD45BEC; Sun, 21 Apr 2024 23:22:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="IjERKFur"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="gbeOhgDI"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="IjERKFur"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="gbeOhgDI" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B59544437; Sun, 21 Apr 2024 23:22:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713741779; cv=none; b=VHjECJhAweST09sRyVDbYTfC2uKMIMS87tVrU7M457DFlb7c3gROOFEGHyhClnvj9GistHxTQ2zzzB17F4WY9Oywj+kshCow2gSeKDC2tg4omYQF0ov5WQLn7ImDjQQ+bCNMKRSmQB9qCt3cwbUY/KQPUK2PQGBjNrQbKCioZN4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713741779; c=relaxed/simple; bh=x7/9k3VUkArG5pgm3qecA36nkdPnWUn28VxB8zg3sgs=; h=Content-Type:MIME-Version:From:To:Cc:Subject:In-reply-to: References:Date:Message-id; b=tyKMaR3ZAWVwh6AxqwZwkDcFQzwMNbOtX6q2wh3cdiNwEUpYO+WxWncFlwH2dia4gP/m9/Id9ceq5l3A1iiArJqqR9Rq00hEx0gODmW5r/8uZaauyC/t9FPI33BglyjaI6NpjjbU7Jf8RtfbjgcTZo1pUiJUvC7ZvrcrcTZuUXU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=IjERKFur; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=gbeOhgDI; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=IjERKFur; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=gbeOhgDI; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B492F3470C; Sun, 21 Apr 2024 23:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1713741775; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=itTVdaSaWpVAwo/eRp+XlnufM44f07MOYwHHeFt+cBo=; b=IjERKFurEfo0l04lIurGTVPkHlOCkl6lPkxF9FFO30jMUDg8cOfPI6XY9rl8cVahn77gHv g8ly4QKY9rQkFxqbNmgmp5ht1aC6mspXRP/1LYq28jQzVqUW24M5ajthM+o7RL8KPzFcvs aLCArjw/wQUL6S71p9/yy/hqMkLbDzE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1713741775; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=itTVdaSaWpVAwo/eRp+XlnufM44f07MOYwHHeFt+cBo=; b=gbeOhgDIjmhSRmotPdrLXo3RqSblX5SSy9WqeZrguDNV9/3Avxf/qeFAKKyZLXhH5QM+WM o4AC2/uGGbOTkWAA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=IjERKFur; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=gbeOhgDI DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1713741775; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=itTVdaSaWpVAwo/eRp+XlnufM44f07MOYwHHeFt+cBo=; b=IjERKFurEfo0l04lIurGTVPkHlOCkl6lPkxF9FFO30jMUDg8cOfPI6XY9rl8cVahn77gHv g8ly4QKY9rQkFxqbNmgmp5ht1aC6mspXRP/1LYq28jQzVqUW24M5ajthM+o7RL8KPzFcvs aLCArjw/wQUL6S71p9/yy/hqMkLbDzE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1713741775; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=itTVdaSaWpVAwo/eRp+XlnufM44f07MOYwHHeFt+cBo=; b=gbeOhgDIjmhSRmotPdrLXo3RqSblX5SSy9WqeZrguDNV9/3Avxf/qeFAKKyZLXhH5QM+WM o4AC2/uGGbOTkWAA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 5F37E13687; Sun, 21 Apr 2024 23:22:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id ar9KAMmfJWYobAAAD6G6ig (envelope-from ); Sun, 21 Apr 2024 23:22:49 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "NeilBrown" To: "Lex Siegel" Cc: "Chuck Lever" , "Jeff Layton" , "Olga Kornievskaia" , "Dai Ngo" , "Tom Talpey" , "Trond Myklebust" , "Anna Schumaker" , "David S. Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Paolo Abeni" , linux-nfs@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH] xprtsock: Fix a loop in xs_tcp_setup_socket() In-reply-to: <20240420104801.94701-1-usiegl00@gmail.com> References: <20240420104801.94701-1-usiegl00@gmail.com> Date: Mon, 22 Apr 2024 09:22:35 +1000 Message-id: <171374175513.12877.8993642908082014881@noble.neil.brown.name> X-Spam-Level: X-Spamd-Result: default: False [-4.27 / 50.00]; DWL_DNSWL_MED(-2.00)[suse.de:dkim]; NEURAL_HAM_LONG(-1.00)[-1.000]; BAYES_HAM(-0.76)[84.23%]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; RCPT_COUNT_TWELVE(0.00)[16]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; R_RATELIMIT(0.00)[from(RLewrxuus8mos16izbn)]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim]; RCVD_COUNT_TWO(0.00)[2]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Rspamd-Queue-Id: B492F3470C X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Flag: NO X-Spam-Score: -4.27 On Sat, 20 Apr 2024, Lex Siegel wrote: > When using a bpf on kernel_connect(), the call can return -EPERM. > This causes xs_tcp_setup_socket() to loop forever, filling up the > syslog and causing the kernel to freeze up. >=20 > Signed-off-by: Lex Siegel > --- > net/sunrpc/xprtsock.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c > index bb9b747d58a1..47b254806a08 100644 > --- a/net/sunrpc/xprtsock.c > +++ b/net/sunrpc/xprtsock.c > @@ -2446,6 +2446,8 @@ static void xs_tcp_setup_socket(struct work_struct *w= ork) > /* Happens, for instance, if the user specified a link > * local IPv6 address without a scope-id. > */ > + case -EPERM: > + /* Happens, for instance, if a bpf is preventing the connect */ This will propagate -EPERM up into other layers which might not be ready to handle it. It might be safer to map EPERM to an error we would be more likely to expect from the network system - such as ECONNREFUSED or ENETDOWN. Better still would be for kernel_connect() to return a more normal error code - not EPERM. If that cannot be achieved, then I think it would be best for the sunrpc code to map EPERM to something else at the place where kernel_connect() is called - catch it early. NeilBrown > case -ECONNREFUSED: > case -ECONNRESET: > case -ENETDOWN: > --=20 > 2.39.3 >=20 >=20