From nobody Sat Jan 11 05:00:27 2025 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 4YVRDC56Zqz5lFrk; Sat, 11 Jan 2025 05:00:27 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVRDC3G5Wz4cKM; Sat, 11 Jan 2025 05:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736571627; 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=7ghHi0/rl64uwqTBzOPGTvHUOKjbBjx8vfPCOPuaFvM=; b=vmsOVLSdqVW4gChzJF/dfoNkZUOO/HMCC0Za2WfR4ZA/S60F5azIua5UqU7/PuUmy4ef21 oQDBenz+brpMv8PsIumaYacgR2yVnkBZH6RsPV7sDqtq8yWTEUdEolCH1kZT8V7oMfqQDn N4FGhE0U3+fmfdpioyJSiRQNr3y3MX8rp8ORacVAN32B5Mtn/WpaUuIGVBKHPy2JKI27jW Goem410kpN4cAFeJ31sfdWe3VICEV1vMumN7H/N/qBv3FKBSOmfhO8gofCbdujxZyqpEG2 4LYuLFQcwAMmnUwCejs0JsXGCB0j1Jta29j8MGyG9I1KWp/XvDQZjRuh9T1KCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736571627; 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=7ghHi0/rl64uwqTBzOPGTvHUOKjbBjx8vfPCOPuaFvM=; b=JnaBzIhBOzPFNCQX92blILY/xFa++WZKfDorlV+s5ZS18pQj9GsHQb0/Xvrz1CS1ri7FRH rdsA7wovJ8SkMH+JIpRW8AI79PMpIxu+re0POkASr30dYSm2k3joKhXHFJsJON/HCJHaAj n9jNa9pV/uHcemLuvySobjouN6VHthhGaEDTvQISDSq8PpE2oJgSiEZyf7yMa6W9Ql7jsC heiGDZJuAzrsx+J5jQP7k+/tF80U1dK/kIfx5pimLp+FWRdEHAHSlUlbDlS9ejsWx5ejIW Ye0tgPJ6yW3GFliejJHAIDiopdPeZR4zY6Y4/efa6gNMmsvxVbtxaA8C5deSIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736571627; a=rsa-sha256; cv=none; b=g1fhaR8WXBBZb+cLWLHO/n/CptSUy0KzEFA7CO1HaG1M93Tkp1NJA7Fi3wVQuAP9xhTL5s +3UX6TLBG1TsEAVcmLEVGAaEn7pOTjMR+gZ3vkvCpbXkAn8eKlQzNx9V92/LFVEUF6Lfej 8C3jNqGGBy3NpQKGz4gJa/qE3aoORmzQbkNg5WQqdBeK6hTl18szWSWGMLO0Ivz6R9cA/E FmdAZc1nsXGMpJ7CiWrvT/5VlENADcDO9+vSa+BOa/I1/89Bolo+3ksLFO+YB161KTyg4m nFrB+bDfhHzGyMvoc2DjCIXhMuk4u9+tagnYc0HlNKjJyqT6fvncwK9TkjLUWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YVRDC0xj7zksV; Sat, 11 Jan 2025 05:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B50Rsl022508; Sat, 11 Jan 2025 05:00:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B50R7u022505; Sat, 11 Jan 2025 05:00:27 GMT (envelope-from git) Date: Sat, 11 Jan 2025 05:00:27 GMT Message-Id: <202501110500.50B50R7u022505@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: bbe6559cf958 - main - netlink: fix size comparison 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bbe6559cf958a9016cb18ff1833ebd3a884f349f Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=bbe6559cf958a9016cb18ff1833ebd3a884f349f commit bbe6559cf958a9016cb18ff1833ebd3a884f349f Author: Gleb Smirnoff AuthorDate: 2025-01-11 04:57:55 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-11 04:57:55 +0000 netlink: fix size comparison We want to check the size of the header, not a pointer to it. Reviewed by: melifaro, markj Differential Revision: https://reviews.freebsd.org/D48309 --- sys/netlink/netlink_generic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netlink/netlink_generic.c b/sys/netlink/netlink_generic.c index 623531492173..b78ab80ab3c2 100644 --- a/sys/netlink/netlink_generic.c +++ b/sys/netlink/netlink_generic.c @@ -67,7 +67,8 @@ genl_handle_message(struct nlmsghdr *hdr, struct nl_pstate *npt) return (ENOTSUP); } - if (__predict_false(hdr->nlmsg_len < sizeof(hdr) + GENL_HDRLEN)) { + if (__predict_false(hdr->nlmsg_len < sizeof(struct nlmsghdr) + + GENL_HDRLEN)) { NLP_LOG(LOG_DEBUG, nlp, "invalid message size: %d", hdr->nlmsg_len); return (EINVAL); }