android_kernel_samsung_msm8976/fs/lockd
Andrey Ryabinin db13625b09 lockd: create NSM handles per net namespace
commit 0ad95472bf169a3501991f8f33f5147f792a8116 upstream.

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>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-03 15:06:20 -08:00
..
Makefile
clnt4xdr.c
clntlock.c LOCKD: Don't call utsname()->nodename from nlmclnt_setlockargs 2013-08-14 22:59:08 -07:00
clntproc.c LOCKD: Don't call utsname()->nodename from nlmclnt_setlockargs 2013-08-14 22:59:08 -07:00
clntxdr.c
grace.c
host.c lockd: create NSM handles per net namespace 2016-03-03 15:06:20 -08:00
mon.c lockd: create NSM handles per net namespace 2016-03-03 15:06:20 -08:00
netns.h lockd: create NSM handles per net namespace 2016-03-03 15:06:20 -08:00
svc.c lockd: create NSM handles per net namespace 2016-03-03 15:06:20 -08:00
svc4proc.c lockd: create NSM handles per net namespace 2016-03-03 15:06:20 -08:00
svclock.c lockd: send correct lock when granting a delayed lock. 2014-02-22 12:41:27 -08:00
svcproc.c lockd: create NSM handles per net namespace 2016-03-03 15:06:20 -08:00
svcshare.c
svcsubs.c
xdr.c
xdr4.c