]> git.baikalelectronics.ru Git - kernel.git/commit
lockd: lost rollback of set_grace_period() in lockd_down_net()
authorVasily Averin <vvs@virtuozzo.com>
Thu, 2 Nov 2017 10:03:42 +0000 (13:03 +0300)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 27 Nov 2017 21:45:11 +0000 (16:45 -0500)
commit415aec2cc9e3f81669f4c1d290b88099530bb2ac
tree80d14fdd5067ee6d26a13765daa50a50abf18ebf
parent4d4441dca5eaec82511bb205cf5b20a8a22a1a37
lockd: lost rollback of set_grace_period() in lockd_down_net()

Commit 6e6eff2f44925 ("lockd: fix lockd shutdown race") is incorrect,
it removes lockd_manager and disarm grace_period_end for init_net only.

If nfsd was started from another net namespace lockd_up_net() calls
set_grace_period() that adds lockd_manager into per-netns list
and queues grace_period_end delayed work.

These action should be reverted in lockd_down_net().
Otherwise it can lead to double list_add on after restart nfsd in netns,
and to use-after-free if non-disarmed delayed work will be executed after netns destroy.

Fixes: 6e6eff2f4492 ("lockd: fix lockd shutdown race")
Cc: stable@vger.kernel.org
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/lockd/svc.c