Skip to content

RFC utsns: RPC/NFS bug rework

Matt Helsley containers linux-nfs lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 42 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Remove useless utsname.h includesfs/lockd/xdr.c fs/lockd/xdr4.c fs/nfs/nfs2xdr.c +5 more+0 -80 replies
2/4sunrpc: Use utsnamespacesnet/sunrpc/clnt.c+5 -237 replies
3/4sunrpc: Improve UTS namespace workaroundfs/lockd/clntproc.c fs/nfs/client.c fs/nfs/super.c +4 more+44 -43 replies
4/4Represent RPC Callersfs/lockd/clntproc.c fs/nfs/client.c fs/nfs/super.c +6 more+88 -582 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/4] utsns: RPC/NFS bug rework

This series replaces the workaround for a bug reported by Cedric Le Goater <[email protected]> back in September:

Quoted 4 lines

On a system with nfs mounts, if a task unshares its mount namespace, a oops can occur when the system is rebooted if the task is the last to unreference the nfs mount. It will try to create a rpc request using utsname() which has been invalidated by free_nsproxy().

Cedric worked around this bug by always using the initial uts namespace's nodename (see commit: 63ffc23d307c9534c732edd87895e37b223004a3).

This is a non-ideal solution because uts namespace nodenames are reported as the hostname during RPC authentication. Consider a machine configured to export directories via NFS from a parent container to designated "trusted" child containers. It would be unable to rely on the hostname during RPC authentication -- forcing the administration of more advanced authentication systems than might otherwise be necessary.

The goal of this series is to report a namespace's UTS nodename rather than the initial UTS namespace's nodename during RPC-call authentication -- much as before Cedric's workaround. By changing the way that the nodename is cached and fetched we can simultaneously avoid the NULL dereference during shutdown and ensure that amalgamated RPC services (such as statd, lockd, mountd for NFS) see a consistent nodename.

Cheers,
-Matt Helsley