All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Jeff Layton <jlayton@kernel.org>,
	syzbot <syzbot+4207adf14e7c0981d28d@syzkaller.appspotmail.com>,
	Dai.Ngo@oracle.com, chuck.lever@oracle.com, kolga@netapp.com,
	linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org,
	neilb@suse.de, syzkaller-bugs@googlegroups.com, tom@talpey.com,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>
Subject: Re: [syzbot] [nfs?] INFO: task hung in nfsd_nl_listener_get_doit
Date: Mon, 17 Jun 2024 17:00:36 +0200	[thread overview]
Message-ID: <ZnBPlMOpkLQghYR6@lore-desk> (raw)
In-Reply-To: <20240617075129.7cb9ad1d@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1619 bytes --]

> On Mon, 17 Jun 2024 06:15:25 -0400 Jeff Layton wrote:
> > We've had number of these reports recently. I think I understand what's
> > happening but I'm not sure how to fix it. The problem manifests as a
> > stuck nfsd_mutex:
> > 
> > nfsd_nl_rpc_status_get_start takes the nfsd_mutex, and it's released in
> > nfsd_nl_rpc_status_get_done. These are the ->start and ->done
> > operations for the rpc_status_get dumpit routine.
> > 
> > I think syzbot is triggering one of the two "goto errout_skb"
> > conditions in netlink_dump (not sure which). In those cases we end up
> > returning from that function without calling ->done, which would lead
> > to the hung mutex like we see here.
> > 
> > Is this a bug in the netlink code, or is the rpc_status_get dumpit
> > routine not using ->start and ->done correctly?
> 
> Dumps are spread over multiple recvmsg() calls, even if we error out
> the next recvmsg() will dump again, until ->done() is called. And we'll
> call ->done() if socket is closed without reaching the end.
> 
> But the multi-syscall nature puts us at the mercy of the user meaning
> that holding locks ->start() to ->done() is a bit of a no-no.
> Many of the dumps dump contents of an Xarray, so its easy to remember
> an index and continue dumping from where we left off.

I guess we can grab the nfsd_mutex lock in nfsd_nl_rpc_status_get_dumpit() and get
rid of nfsd_nl_rpc_status_get_start() and nfsd_nl_rpc_status_get_done()
completely. We will just verify the nfs server is running each time the dumpit
callback is executed. What do you think?

Regards,
Lorenzo

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2024-06-17 15:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-15 10:39 [syzbot] [nfs?] INFO: task hung in nfsd_nl_listener_get_doit syzbot
2024-06-17 10:15 ` Jeff Layton
2024-06-17 14:51   ` Jakub Kicinski
2024-06-17 15:00     ` Lorenzo Bianconi [this message]
2024-06-17 15:45     ` Jeff Layton
2024-06-17 16:26 ` Lorenzo Bianconi
2024-06-17 16:26   ` syzbot
2024-06-17 16:49   ` Jeff Layton
2024-06-17 17:21   ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZnBPlMOpkLQghYR6@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=Dai.Ngo@oracle.com \
    --cc=chuck.lever@oracle.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jlayton@kernel.org \
    --cc=kolga@netapp.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=pabeni@redhat.com \
    --cc=syzbot+4207adf14e7c0981d28d@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.