From nobody Tue Mar 07 13:28:24 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 4PWGVK18HYz3w960; Tue, 7 Mar 2023 13:28:25 +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 4PWGVJ4v9hz3vSC; Tue, 7 Mar 2023 13:28:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678195704; 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=1/w7h2S3SYoAAL8g2wydtEvHx8EU9/HvJYtEcVOLS5k=; b=WBXgRl0ExQQVh7cN8KQ+ZXA9NJfUfFVL/rESSEb7Ud8cDzNScQcPk+6J8/swFomx+RN/av FNbTgkJHRDtCXwvH0gxnxMZX20Z/O83FjR1KHijY0Kb8xfDSLbLLotSiugGwgLblJDZ8P5 ZVF96pK2Xd7eFrfrYJT7IvVHRbTdTDfvpxTv+f3wznRJGtrzDIKaxObmOCk6xwSjCKbTxh BZbIzBcA5lQoW3O4C1G64ImSdLwDPEE4idlF9B/NC+oPSm6HSyc+0oYQSXBWfJIXgfhKnY rGgRZ3J5MY1eyIoPlnM6pJkzYZHKZ/5zWbBcSkmMkdClJdNNbpUw7Bu6LdA6Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678195704; 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=1/w7h2S3SYoAAL8g2wydtEvHx8EU9/HvJYtEcVOLS5k=; b=Dy/6wWr+K7inM3iyHyu1EUzxqJjTyDPRH12a4zjLMmokIvYq0z0qSYBkU5kILwXyzaGVG8 x6rCnUu9v65QT3O1OA3NbTLCCT4T3odlhOmn0VJFmXuhrHijGHiUAapKpMgqZcrR7TKvo1 3rbjWkcc+oF6Xms3mHTf21B3UTj4i837/NH/84oP/myW/AKLntJORI6evqOKqGeR4z/5SV peCGQ+KsI0g4hE8Cqgu1LXtsuD4k5MRPeK7ckctoHgV+YaEjCOSjwHsLp6biFmCsyYeJn6 5emQRr6ikoeCiPTib74fa2YmYXRK9c5JGqh10uw5kIsndZRiYWxKIuYS1sG7NQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678195704; a=rsa-sha256; cv=none; b=fm2SpQRpBg3IXqbBBrjIkQtbBlrijbFjC1tGHlZot+efQu3diTcFyiIJXlqcIDrkMDfAHU GbExguvkF3cLp3sISx2Z7nKGdWP3471G/ngszJlO/A2Wa3clPSReNCfs5gK7fE8dRz5e1P zC1UYhD026l+5IVdyKMBsVOe5D7ymUmZdrruq1duKkX/ma8gHv8vJ1dxhV3/YtvSAW55Ub IR9lPdDMC1+ObkrL38gCN31SHpnN6fEZPC9v6FrAneI2o/GamEX8ysE1o/95sD8StFZ4Px /sBxSSk3SXeE1fh7Wh+UbTPhX8oCGDiHxAa1a7dUEGQNeJ4xqFgsm2ucV2JQAw== 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 4PWGVJ4005zlg8; Tue, 7 Mar 2023 13:28:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 327DSOxW077991; Tue, 7 Mar 2023 13:28:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 327DSOhg077990; Tue, 7 Mar 2023 13:28:24 GMT (envelope-from git) Date: Tue, 7 Mar 2023 13:28:24 GMT Message-Id: <202303071328.327DSOhg077990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 4182ec520407 - releng/13.2 - netlink: fix OOB read in genetlink 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 4182ec520407a702ec2b670d597ca4f7d80ef58b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4182ec520407a702ec2b670d597ca4f7d80ef58b commit 4182ec520407a702ec2b670d597ca4f7d80ef58b Author: Alexander V. Chernikov AuthorDate: 2023-02-18 17:24:59 +0000 Commit: Ed Maste CommitDate: 2023-03-07 13:28:06 +0000 netlink: fix OOB read in genetlink Reported by: Coverity Scan Approved by: re (cperciva) CID: 1498863 (cherry picked from commit 8f7455a9265f4952f885b06c08c57fcce6f16e5c) (cherry picked from commit d9d596bb2ce04bbec5ea811342efd4216c1fc2a3) --- sys/netlink/netlink_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netlink/netlink_generic.c b/sys/netlink/netlink_generic.c index 066379e2afae..a16fdc312daa 100644 --- a/sys/netlink/netlink_generic.c +++ b/sys/netlink/netlink_generic.c @@ -267,7 +267,7 @@ genl_handle_message(struct nlmsghdr *hdr, struct nl_pstate *npt) int family_id = (int)hdr->nlmsg_type - GENL_MIN_ID; - if (__predict_false(family_id < 0 || family_id > MAX_FAMILIES)) { + if (__predict_false(family_id < 0 || family_id >= MAX_FAMILIES)) { NLP_LOG(LOG_DEBUG, nlp, "invalid message type: %d", hdr->nlmsg_type); return (ENOTSUP); }