mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 08:26:59 +00:00
lockd: double unregister of inetaddr notifiers
lockd_up() can call lockd_unregister_notifiers twice:
inside lockd_start_svc() when it calls lockd_svc_exit_thread()
and then in error path of lockd_up()
Patch forces lockd_start_svc() to unregister notifiers in all error cases
and removes extra unregister in error path of lockd_up().
Fixes: cb7d224f82
"lockd: unregister notifier blocks if the service ..."
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Cc: stable@vger.kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
53da6a53e1
commit
dc3033e16c
1 changed files with 9 additions and 11 deletions
|
@ -369,6 +369,7 @@ static int lockd_start_svc(struct svc_serv *serv)
|
||||||
printk(KERN_WARNING
|
printk(KERN_WARNING
|
||||||
"lockd_up: svc_rqst allocation failed, error=%d\n",
|
"lockd_up: svc_rqst allocation failed, error=%d\n",
|
||||||
error);
|
error);
|
||||||
|
lockd_unregister_notifiers();
|
||||||
goto out_rqst;
|
goto out_rqst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -459,13 +460,16 @@ int lockd_up(struct net *net)
|
||||||
}
|
}
|
||||||
|
|
||||||
error = lockd_up_net(serv, net);
|
error = lockd_up_net(serv, net);
|
||||||
if (error < 0)
|
if (error < 0) {
|
||||||
goto err_net;
|
lockd_unregister_notifiers();
|
||||||
|
goto err_put;
|
||||||
|
}
|
||||||
|
|
||||||
error = lockd_start_svc(serv);
|
error = lockd_start_svc(serv);
|
||||||
if (error < 0)
|
if (error < 0) {
|
||||||
goto err_start;
|
lockd_down_net(serv, net);
|
||||||
|
goto err_put;
|
||||||
|
}
|
||||||
nlmsvc_users++;
|
nlmsvc_users++;
|
||||||
/*
|
/*
|
||||||
* Note: svc_serv structures have an initial use count of 1,
|
* Note: svc_serv structures have an initial use count of 1,
|
||||||
|
@ -476,12 +480,6 @@ int lockd_up(struct net *net)
|
||||||
err_create:
|
err_create:
|
||||||
mutex_unlock(&nlmsvc_mutex);
|
mutex_unlock(&nlmsvc_mutex);
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
err_start:
|
|
||||||
lockd_down_net(serv, net);
|
|
||||||
err_net:
|
|
||||||
lockd_unregister_notifiers();
|
|
||||||
goto err_put;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(lockd_up);
|
EXPORT_SYMBOL_GPL(lockd_up);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue