diff options
author | Vasily Averin <vvs@virtuozzo.com> | 2017-11-10 08:19:35 +0100 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2017-11-27 22:45:11 +0100 |
commit | 2317dc557a3b6d5b73b697034611d658eb2cbde9 (patch) | |
tree | 9854e4dff8bb6981a73aca72427187d3afea4d52 /fs/nfsd/netns.h | |
parent | race of lockd inetaddr notifiers vs nlmsvc_rqst change (diff) | |
download | linux-2317dc557a3b6d5b73b697034611d658eb2cbde9.tar.xz linux-2317dc557a3b6d5b73b697034611d658eb2cbde9.zip |
race of nfsd inetaddr notifiers vs nn->nfsd_serv change
nfsd_inet[6]addr_event uses nn->nfsd_serv without taking nfsd_mutex,
which can be changed during execution of notifiers and crash the host.
Moreover if notifiers were enabled in one net namespace they are enabled
in all other net namespaces, from creation until destruction.
This patch allows notifiers to access nn->nfsd_serv only after the
pointer is correctly initialized and delays cleanup until notifiers are
no longer in use.
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Tested-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/netns.h')
-rw-r--r-- | fs/nfsd/netns.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h index 1c91391f4805..36358d435cb0 100644 --- a/fs/nfsd/netns.h +++ b/fs/nfsd/netns.h @@ -119,6 +119,9 @@ struct nfsd_net { u32 clverifier_counter; struct svc_serv *nfsd_serv; + + wait_queue_head_t ntf_wq; + atomic_t ntf_refcnt; }; /* Simple check to find out if a given net was properly initialized */ |