Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Oct 2023 00:58:55 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: d08ef6f7da39 - stable/14 - netdump: Check the return value of ifunit_ref()
Message-ID:  <202310090058.3990wta5040259@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by markj:

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

commit d08ef6f7da3943dc49999988e6c2ac03644bdaf1
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-10-02 12:08:20 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-10-09 00:41:42 +0000

    netdump: Check the return value of ifunit_ref()
    
    We may fail to match if the specific interface doesn't exist or was
    renamed.
    
    PR:             273715
    Reported by:    grembo
    MFC after:      1 week
    
    (cherry picked from commit d94d07d58141dcff48f01c6b3e5a31de9d7a7938)
---
 sys/netinet/netdump/netdump_client.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/netinet/netdump/netdump_client.c b/sys/netinet/netdump/netdump_client.c
index 35167f690ed2..0f0cf4dbb79f 100644
--- a/sys/netinet/netdump/netdump_client.c
+++ b/sys/netinet/netdump/netdump_client.c
@@ -451,6 +451,8 @@ netdump_configure(struct diocskerneldump_arg *conf, struct thread *td)
 		CURVNET_SET(vnet0);
 		ifp = ifunit_ref(conf->kda_iface);
 		CURVNET_RESTORE();
+		if (ifp == NULL)
+			return (ENODEV);
 		if (!DEBUGNET_SUPPORTED_NIC(ifp)) {
 			if_rele(ifp);
 			return (ENODEV);



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