From nobody Fri May 22 14:25:00 2026 X-Original-To: dev-commits-src-main@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 4gMSGh4Tjfz6frhV for ; Fri, 22 May 2026 14:25:00 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gMSGh3tjGz3Q9t for ; Fri, 22 May 2026 14:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779459900; 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=HsZAABT4buKvxmV0oImrH6nr7Bv9NW2HD+sBdoNua44=; b=Awbcf1UiwXuFqvpuL4euAiUu55KPMq4M2dzBmAAfw4J2UYefDxfWn2DCb5plirM3Ry6qPN YwJ3Uur8eowciqOpMzAB9U+EieHXRrpEIqg+GV5iswAlMAEoXNMKHRV+jk9LHNE8FxY7fj 0TXWIwJb45mhOVQ6FEVdwtzCWFwFg6py90gOkZsSDNzrlj/+DjL0Eoi0OeEuNeVxxKtuoN le75Q2aVZVK7+d/FVd0kbgdvdr/e5BA1dZDoVmk3vqV4yeFKFdGaJ1b+zhZ0xiSJG2VH5B gc1Y4fF73MeereGZKEvi94mRouHAcjR7Oj55TrCxVNrLE6BWjCup+ysdsKztwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1779459900; a=rsa-sha256; cv=none; b=IALYQ8mAojabUksK52HWA0Igerglyh+Es80/AEoH3hrGbq3sUSpy0smbtDZ8tJC9YURdYt FPU2/5C/KbJCsfd+slha1TiFcrxEXupWfUwvLodZVE/TwCmEohc7OqR7Ekx+gPiDtVJiXd 19oGVzvB/GWsotoieHvhEl8kMyAEBzxk5ZLHYaSxQsa+YAnnUXW4LBubBGaTeq1CUlKGaT ujPS4VmHdWS/TveRLHwfKYxkCTew1w8zQGpOf+CR9FZw9aZu5VSrKPh/HpiwYwU4DPhxSH vacUuqQJLcQHgbHJj5zTqb6j13sM7JMWicNj01EuLQSL6fP81TVGNbZr6BeNpQ== 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=1779459900; 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=HsZAABT4buKvxmV0oImrH6nr7Bv9NW2HD+sBdoNua44=; b=CGXp4dlQULjQ1pxldVjLvZeEmPhhf52VadhHcBADaCDc9piDV8h75w99KGcTazCh75VuRO UoFc0KR/XiOogfp8iwACSgQ5+zz8MvLwos38NFL/lPknfZvctztPWNRE70MDomI/Hd+pvZ rSjM5FXlgKujyw4r4P7qN/EW8/f6kipVF2mirMvvpT3tA0cB6riXfnRDqXGWeRWcTUmPpo Ka0g65JNHz3rSgzHFjP+2+hQVsEH/WsXwPOb28DGoPYqt5mMrcF0yOmsCVmC7+vMMahEpU 1ZUlrZZ+bOGVclkqOJJCJtvqQg/wBY3LCOnCVmfTnZKc23gm1yrhlqUxRALPOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gMSGh34Cgz80C for ; Fri, 22 May 2026 14:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 197c8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 22 May 2026 14:25:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 1a4ad649cb13 - main - netlink: Avoid undefined behaviour List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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/main X-Git-Reftype: branch X-Git-Commit: 1a4ad649cb135501f0bee56a4214e8c904ca402e Auto-Submitted: auto-generated Date: Fri, 22 May 2026 14:25:00 +0000 Message-Id: <6a10673c.197c8.27ef3f@gitrepo.freebsd.org> The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1a4ad649cb135501f0bee56a4214e8c904ca402e commit 1a4ad649cb135501f0bee56a4214e8c904ca402e Author: Ed Maste AuthorDate: 2026-05-22 00:50:00 +0000 Commit: Ed Maste CommitDate: 2026-05-22 14:21:11 +0000 netlink: Avoid undefined behaviour Even though it is not dereferenced, it is UB to take the address of an out of bounds array element. Reviewed by: pouria, bz, des, adrian Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57158 --- sys/netlink/netlink_generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netlink/netlink_generic.c b/sys/netlink/netlink_generic.c index fb74860e42b3..c2f82eed5656 100644 --- a/sys/netlink/netlink_generic.c +++ b/sys/netlink/netlink_generic.c @@ -127,13 +127,13 @@ genl_handle_message(struct nlmsghdr *hdr, struct nl_pstate *npt) } family_id = hdr->nlmsg_type - GENL_MIN_ID; - gf = &families[family_id]; if (__predict_false(family_id >= MAX_FAMILIES || - gf->family_name == NULL)) { + families[family_id].family_name == NULL)) { NLP_LOG(LOG_DEBUG, nlp, "invalid message type: %d", hdr->nlmsg_type); return (ENOTSUP); } + gf = &families[family_id]; struct genlmsghdr *ghdr = (struct genlmsghdr *)(hdr + 1);