linux-xiaomi-chiron/include/linux/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
..
bind.h Lockd: pass network namespace to creation and destruction routines 2012-04-11 17:55:06 -04:00
debug.h lockd: eliminate LOCKD_DEBUG 2014-11-24 17:24:08 -05:00
lockd.h lockd: create NSM handles per net namespace 2015-10-12 17:31:05 -04:00
nlm.h
share.h
xdr.h nfs: replace uses of __constant_{endian} 2009-03-18 17:30:51 -04:00
xdr4.h SUNRPC: constify the rpc_program 2012-01-31 19:28:20 -05:00