Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Sep 2025 15:00:31 GMT
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 70730cd21c9f - main - rpc_generic.c: Fix a rpcbind core dump when rpcinfo is done
Message-ID:  <202509281500.58SF0VAW056607@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=70730cd21c9f2b0a80ff07e4491c0fe30f2d87c5

commit 70730cd21c9f2b0a80ff07e4491c0fe30f2d87c5
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2025-09-28 14:56:17 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2025-09-28 14:57:34 +0000

    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)")
---
 lib/libc/rpc/rpc_generic.c | 4 ++++
 1 file changed, 4 insertions(+)

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 -



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202509281500.58SF0VAW056607>