aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2025-09-28 14:56:17 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2025-09-28 14:57:34 +0000
commit70730cd21c9f2b0a80ff07e4491c0fe30f2d87c5 (patch)
treed46cd4e887a3d82f4b3581f1b5b6e3bf17e1bc42
parentbbec2c9a6d9a9b8f6c6edbdd2386dfdcd1c81422 (diff)
rpc_generic.c: Fix a rpcbind core dump when rpcinfo is done
Commit c5d671b added 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: c5d671b711c3 ("libc/rpc: add userland side RPC server over netlink(4)")
-rw-r--r--lib/libc/rpc/rpc_generic.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc/rpc/rpc_generic.c b/lib/libc/rpc/rpc_generic.c
index 0e563f6a5996..8019f2d8f236 100644
--- a/lib/libc/rpc/rpc_generic.c
+++ b/lib/libc/rpc/rpc_generic.c
@@ -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 -