rpc_generic.c: Fix a rpcbind core dump when rpcinfo is done
Commitc5d671badded netlink support to server side rpcbind. However it did not add a case for AF_NETLINK to __rpc_taddr2uaddr_af(). (Reported as PR#289625.) As such, without this patch the r_addr field of the netlink rbllist is NULL, which causes a crash in svc_sendreply() for a Dump query (what rpcinfo does). PR: 289625 Reviewed by: glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D52651 Fixes:c5d671b711("libc/rpc: add userland side RPC server over netlink(4)")
This commit is contained in:
@@ -610,6 +610,10 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf)
|
||||
return NULL;
|
||||
break;
|
||||
#endif
|
||||
case AF_NETLINK:
|
||||
if (asprintf(&ret, "%s", (char *)nbuf->buf) < 0)
|
||||
return NULL;
|
||||
break;
|
||||
case AF_LOCAL:
|
||||
sun = nbuf->buf;
|
||||
if (asprintf(&ret, "%.*s", (int)(sun->sun_len -
|
||||
|
||||
Reference in New Issue
Block a user