linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RFC: Fixing net/sunrpc/cache.c: cache_listeners_exist() function for rogue process reading a 'channel' file
@ 2019-07-25 16:48 Dave Wysochanski
  2019-07-25 18:54 ` Bruce Fields
  0 siblings, 1 reply; 11+ messages in thread
From: Dave Wysochanski @ 2019-07-25 16:48 UTC (permalink / raw)
  To: NeilBrown, Bruce Fields; +Cc: Linux NFS Mailing List

Neil, Bruce, and others,

I want to see if we can improve cache_listeners_exist() to not be
fooled at all by a random process reading a 'channel' file.  Prior
attempts have been made and Neil your most recent commit mitigated the
effects however doesn't really solve it completely:
9d69338c8c5f "sunrpc/cache: handle missing listeners better"

Here are a couple approaches, based on my understanding of the
interface and what any legitimate "user of the channel files" (aka
daemons or userspace programs, most if not all live in nfs-utils) do in
practice:
1) rather than tracking opens for read, track opens for write on the
channel file (i.e. the 'readers' member in cache_detail)
2) in addition to or in place of #1, track calls to cache_poll()

Basically the above would create a 'cache_daemon_exists()' function in
place of the existing 'cache_listeners_exist()' and then add some
further logic to it.  Do you think that is a valid approach or do you
see problems with it?

Because this keeps coming up in one shape or form and is hard to
troubleshoot when it occurs, I think we should fix this once and for
all so I'm looking for feedback on approaches.  I thought of going down
the road of a more elaborate daemon / kernel registration but that
would require carefully making sure we have backward compatibility when
variants of nfs-utils and kernel are installed.  I think it may be
worth looking at less invasive approaches first such as the above, but
am open to feedback.

Thanks.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-07-30 15:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-25 16:48 RFC: Fixing net/sunrpc/cache.c: cache_listeners_exist() function for rogue process reading a 'channel' file Dave Wysochanski
2019-07-25 18:54 ` Bruce Fields
2019-07-25 21:44   ` [RFC PATCH] SUNRPC: Harden the cache 'channel' interface to only allow legitimate daemons Dave Wysochanski
2019-07-25 21:50     ` J. Bruce Fields
2019-07-26 13:59       ` Dave Wysochanski
2019-07-26 22:33   ` [RFC PATCH] SUNRPC: Track writers of the 'channel' file to improve cache_listeners_exist Dave Wysochanski
2019-07-29 21:51     ` J. Bruce Fields
2019-07-30  0:02       ` NeilBrown
2019-07-30  0:49         ` J. Bruce Fields
2019-07-30  1:14           ` NeilBrown
2019-07-30 15:46             ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).