]> git.baikalelectronics.ru Git - kernel.git/commit
race of lockd inetaddr notifiers vs nlmsvc_rqst change
authorVasily Averin <vvs@virtuozzo.com>
Fri, 10 Nov 2017 07:19:26 +0000 (10:19 +0300)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 27 Nov 2017 21:45:11 +0000 (16:45 -0500)
commitce8ee0bf1f82a260f1956ff6f6371b77bf40d298
tree0e9780bbbd7ae2aa0913a5ebbff8822d5fa7edd4
parent2591916ef620a567dc6b35909c4b08b29e1a7661
race of lockd inetaddr notifiers vs nlmsvc_rqst change

lockd_inet[6]addr_event use nlmsvc_rqst without taken nlmsvc_mutex,
nlmsvc_rqst can be changed during execution of notifiers and crash the host.

Patch enables access to nlmsvc_rqst only when it was correctly initialized
and delays its cleanup until notifiers are no longer in use.

Note that nlmsvc_rqst can be temporally set to ERR_PTR, so the "if
(nlmsvc_rqst)" check in notifiers is insufficient on its own.

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Tested-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/lockd/svc.c