From nobody Mon Oct 02 12:09:55 2023 X-Original-To: dev-commits-src-all@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 4RzfsH2K16z4w1Nw; Mon, 2 Oct 2023 12:09:55 +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 4RzfsH1m88z3Kqf; Mon, 2 Oct 2023 12:09:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696248595; 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=bbxFeYwcD2kkCjy43uLku2aexFM9/bc3iUTucSb9L9s=; b=yicxgLJWc/vJ55q7JRR1IaLpMJAW9cHEa+15W9H1OW0h93E84HZIuLTBpAu5Jb35vQW4k9 jHQU9h3aHz2wCAGLwsKNZKm737Qu6CDIw36STDnxKjsyYMYAvqgTWo6iDK2WJ40BQSMP6Z 58YSQspwv/zYaHG6nU9EV18kqw1jPaKV3Et8h8f/KRjosJLjPSltfaS/tIG5rL4JkL0xkH zu5BNXE0DMsG3zD3bS/gThVrEbdQilTz03+4uhLXwIDNFbEBOqg+upRM5wzaEiMMcXmchG kg19z662McET0kxV/ctK9pmRgUqmzdchSvoCaT4h9HfxWBL1dNxRM7kcFKp9TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696248595; a=rsa-sha256; cv=none; b=PYm9+1WuiltbaAFxW2sMhnh2qi0phQqZy+N+2D5wTB35IeP3/r+bHDIaAJ6cWoCCsqPa8T HN6gzB9aQiRvYmZKUaUk2xhsEmO9vvYkEZenjZ4eTyz/q1y7ZJ5ISXa+Vhj9nchs3NCNmW uVp7AMnNW/8cqaVFQYws9gv3Qf0/LjqZqVghngg4sWFiprprrGoC7tWy5Cz6NhDUgx32rs HihzGjuP7xCmiWcTkq32yFd7I0B2ePudA3npsI9L8v91Kt6S9blub9jGi87/iYQ6HpFK/7 YnMnaSMCVdUxnIQP/3RgWBT/txE8Bag7wxqgWkE90VCzs4rx6s3bMTpzHyHElA== 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=1696248595; 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=bbxFeYwcD2kkCjy43uLku2aexFM9/bc3iUTucSb9L9s=; b=LgMBUCdqBZy/qGWUJGDvKJlxXL/HVDC1l8Xb28d2lUW9foxBZ+iV/TK/3i7Gp6ytpYk3DQ 93oWx6zhiFtCZQ94alDC51qcw6eaAs7hCjFoZpTpUur/v5+/HoJfQvlbdJafbXmrUX1Tv9 kHLhUse4/HLpTKUxk5Cpf4ahB5kEcxtBAGhwqONPJoLGcOuSohEoZk93Q6AtVFXB1PWGa5 DImFV6tEoCi2N8qf6h1BZQCpgk8U8YE36bkgk7LB5gE0EZ4moLLVaIMNjSD20zk+/Dj9hz rn+JDUMP9mATuP3ROQuzKUQ9IZpibsod2Q4m5YUzeiFgKd1XFEN9ljP0ImW1zQ== 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 4RzfsH0pqNz1B1h; Mon, 2 Oct 2023 12:09:55 +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 392C9tKJ054179; Mon, 2 Oct 2023 12:09:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 392C9t0x054176; Mon, 2 Oct 2023 12:09:55 GMT (envelope-from git) Date: Mon, 2 Oct 2023 12:09:55 GMT Message-Id: <202310021209.392C9t0x054176@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d94d07d58141 - main - netdump: Check the return value of ifunit_ref() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: d94d07d58141dcff48f01c6b3e5a31de9d7a7938 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d94d07d58141dcff48f01c6b3e5a31de9d7a7938 commit d94d07d58141dcff48f01c6b3e5a31de9d7a7938 Author: Mark Johnston AuthorDate: 2023-10-02 12:08:20 +0000 Commit: Mark Johnston CommitDate: 2023-10-02 12:09:26 +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 --- 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);