libc clnt_com_create: relock rpcsoc_lock earlier when port is obtained from portmapper
Otherwise on mapper failure we goto error handler which expect rpscoc_lock owned, but we do not. PR: 261051 Reported by: RyanCai <ryancaicse@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
e200809190
commit
6d06bc688e
@ -120,11 +120,11 @@ clnt_com_create(struct sockaddr_in *raddr, rpcprog_t prog, rpcvers_t vers, int *
|
||||
proto = strcmp(tp, "udp") == 0 ? IPPROTO_UDP : IPPROTO_TCP;
|
||||
sport = pmap_getport(raddr, (u_long)prog, (u_long)vers,
|
||||
proto);
|
||||
mutex_lock(&rpcsoc_lock); /* pmap_getport is recursive */
|
||||
if (sport == 0) {
|
||||
goto err;
|
||||
}
|
||||
raddr->sin_port = htons(sport);
|
||||
mutex_lock(&rpcsoc_lock); /* pmap_getport is recursive */
|
||||
}
|
||||
|
||||
/* Transform sockaddr_in to netbuf */
|
||||
|
Loading…
Reference in New Issue
Block a user