linux/fs/lockd
Andrey Ryabinin 0ad95472bf lockd: create NSM handles per net namespace
Commit cb7323fffa ("lockd: create and use per-net NSM
 RPC clients on MON/UNMON requests") introduced per-net
NSM RPC clients. Unfortunately this doesn't make any sense
without per-net nsm_handle.

E.g. the following scenario could happen
Two hosts (X and Y) in different namespaces (A and B) share
the same nsm struct.

1. nsm_monitor(host_X) called => NSM rpc client created,
	nsm->sm_monitored bit set.
2. nsm_mointor(host-Y) called => nsm->sm_monitored already set,
	we just exit. Thus in namespace B ln->nsm_clnt == NULL.
3. host X destroyed => nsm->sm_count decremented to 1
4. host Y destroyed => nsm_unmonitor() => nsm_mon_unmon() => NULL-ptr
	dereference of *ln->nsm_clnt

So this could be fixed by making per-net nsm_handles list,
instead of global. Thus different net namespaces will not be able
share the same nsm_handle.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2015-10-12 17:31:05 -04:00
..
clnt4xdr.c nfsd: remove <linux/nfsd/nfsfh.h> 2014-05-06 17:54:53 -04:00
clntlock.c LOCKD: Don't call utsname()->nodename from nlmclnt_setlockargs 2013-08-05 15:03:46 -04:00
clntproc.c LOCKD: Don't call utsname()->nodename from nlmclnt_setlockargs 2013-08-05 15:03:46 -04:00
clntxdr.c nfsd: remove <linux/nfsd/nfsfh.h> 2014-05-06 17:54:53 -04:00
host.c lockd: create NSM handles per net namespace 2015-10-12 17:31:05 -04:00
Makefile lockd: add a /proc/fs/lockd/nlm_end_grace file 2014-09-17 16:33:13 -04:00
mon.c lockd: create NSM handles per net namespace 2015-10-12 17:31:05 -04:00
netns.h lockd: create NSM handles per net namespace 2015-10-12 17:31:05 -04:00
procfs.c lockd: add a /proc/fs/lockd/nlm_end_grace file 2014-09-17 16:33:13 -04:00
procfs.h lockd: add a /proc/fs/lockd/nlm_end_grace file 2014-09-17 16:33:13 -04:00
svc.c lockd: create NSM handles per net namespace 2015-10-12 17:31:05 -04:00
svc4proc.c lockd: create NSM handles per net namespace 2015-10-12 17:31:05 -04:00
svclock.c sunrpc/lockd: fix references to the BKL 2015-01-23 10:29:12 -05:00
svcproc.c lockd: create NSM handles per net namespace 2015-10-12 17:31:05 -04:00
svcshare.c
svcsubs.c nfsd: eliminate NFSD_DEBUG 2015-04-21 16:16:02 -04:00
xdr.c lockd: xdr: Remove unused function 2015-01-15 13:46:27 -05:00
xdr4.c