From nobody Mon Oct 09 18:13:26 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S46bV2yYmz4w0jD; Mon, 9 Oct 2023 18:13:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S46bV2GyPz4M2V; Mon, 9 Oct 2023 18:13:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696875206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aTx1ZpL9him8DXx7lvqjdYO8liEWSNJWYkIOqz0I8Fk=; b=jhWXfBqv8GbwCYbrWEPBXzWsyszQHRTyfLImJeNbuqUwHUcvZw+JX7SnBwHD2RziaNuxO4 25dksiyjYeFhXdW95F1lMXg2z3nuOwLFu6LRSWLRuzNUTVVSe11TfHHqiBh5yywTxFUrMQ awiZ7kYXi+1BW5OKdHkJCfv2c6ODqQ6rbIxu1fZ2sv41o7321NSAwTW14MSgvtw5xnglGs Un6ZCphGkcdfuo2SY+iyaHozC0PxTXZSkYwTYz0fcxrkkpFm/EtyL+LaL0AgMUOuuRvxmf CMd8ahP983yGHtq1mUrkVIdKtkusYzBi/DQBKXw0Xbpil047w3saZ1uo9XtvIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696875206; a=rsa-sha256; cv=none; b=sOWZI7ykABVOP9GWOurFkEu/VBxe+NFl09paT81eW8upFcxQaVEBmRYGscBC4GY/0vBpPS v8WCFL7POBXO0olZ8YoXg0TUKG3cI0o5sdtSGWy93x5Vz9d+ORnJEJk+bR5ViAlqGOGUw/ p4+QGvNmtnBF2eajkl/YdTCzbGbkRQxWY3zkZK6mg/YrrV6Z2s3mbw/3hdbV2BeErwVmwP npcIGbN5Vopi+AEbwVVNfHIVX8B/tts2ZHFoCequnB4dPOHKQAZJ1pnenB3eUGGL9z2ZFl c3hE3g/SWFV8h0gV+VFezDoZIW2UtfbBgT0T46YVBDQnHB2DrHudjsM4X2ghCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696875206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aTx1ZpL9him8DXx7lvqjdYO8liEWSNJWYkIOqz0I8Fk=; b=KWOTkV2kt6Doeonn2MffXCmFuxViDNFIRRkH8aV85iNSQ+kz15Z66G1moRXkjKYQltCLaL X39ReW7ZYcjIGJwQqtStDr1uOzHhCJX4tvHmlpzdTfXlJfOLU3AUUq4/gArZ3FIvVuK42t yZSDHR7rzYOHJah7HIjzL50XXfSy7HbXQXWqxgf5v9Nbe9GvRl5kwtBe0O/dopN9+NTTJ3 Fe6Ko8YoNkpmRQ1vtivGoqU+vgaUW5TcA532ValyOHrv3OjR/0DNJjFDC/JVZfjJ0W6Coi SzPpcMCM64dQRA7QfOediC6+bWAbwOISP68AX0ZJi/4xgecIz1bNHqSwjLSNgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S46bV1LDvz156y; Mon, 9 Oct 2023 18:13:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 399IDQBk072372; Mon, 9 Oct 2023 18:13:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 399IDQ3f072369; Mon, 9 Oct 2023 18:13:26 GMT (envelope-from git) Date: Mon, 9 Oct 2023 18:13:26 GMT Message-Id: <202310091813.399IDQ3f072369@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 862483bd3500 - releng/14.0 - netdump: Check the return value of ifunit_ref() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 862483bd3500aacc1546d6dfaa940a43e23e096b Auto-Submitted: auto-generated The branch releng/14.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=862483bd3500aacc1546d6dfaa940a43e23e096b commit 862483bd3500aacc1546d6dfaa940a43e23e096b Author: Mark Johnston AuthorDate: 2023-10-02 12:08:20 +0000 Commit: Mark Johnston CommitDate: 2023-10-09 18:07:08 +0000 netdump: Check the return value of ifunit_ref() We may fail to match if the specific interface doesn't exist or was renamed. Approved by: re (gjb) PR: 273715 Reported by: grembo MFC after: 1 week (cherry picked from commit d94d07d58141dcff48f01c6b3e5a31de9d7a7938) (cherry picked from commit d08ef6f7da3943dc49999988e6c2ac03644bdaf1) --- 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);