From nobody Thu Sep 19 13:35:38 2024 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 4X8c3G3l22z5Wcfl; Thu, 19 Sep 2024 13:35:38 +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 4X8c3G2wHvz49rc; Thu, 19 Sep 2024 13:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726752938; 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=i4LnjSTVxTKdhAFcvbuWRnkPkfzd3x4WDmV2+puzy+s=; b=xN/EIfDiJxwDMPl4QeMWSssQUTmAR3qYqzHwe8odUQkgjAXapduAE2+w16MWQmjDgP9rQi i1DoFKP5uhJzcYNx/82wnswCwwJcmR5mrLcrlHIZoRD8zRnarw6rtTBdYopbfH8Zw7TuC7 I3cKodotkZHnzR9cAuua8DydjpMS3pseO0Cl8mcSDtCEKfAz9YZ7b/wOjqsXQdVJmX4eSE oeMALzP9NUgefyuzeHmNrN3IhtqlpcASa2Iw9124aOmu/R9Q0Gv1QvFUMt3G+IpFSxj8tZ 54e71PjPRnw/7Xr+f3mHxwhYhIjqxj2qaE8x8woqHV8JGMnCXAC26r42hlBnuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726752938; a=rsa-sha256; cv=none; b=ekqpOBhd2MC2FgD/AaUmO9E11f4GbaJ4qBggHfrhEvCR4SU6QZMli1c6ya6689eVKjFBJY qIvlfu7jwxOba42XLRmwo4C+z49I2v55JRsY1FKSGi/a9/+U3egwuSdkBsFIa2Ou9fXrQX Pm/IdFjScl6ZSxrFpoLaFadagLd9RUGIi/WLfqjxj9hhMHbKFzp6LhLGmooAYAc0FNzWRa QxbQAWhGTRlUehlYwZrbm8bxemtqpK2ARopcAxbNpxHHoTdnqb9iwVYwDZxWuvE7zbsxYw AQh8DJvgI7c0dO3KenpCdMXPjGTDi1yHIqhUSIUL1gt/pnzKiEOkWzaz6li/XQ== 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=1726752938; 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=i4LnjSTVxTKdhAFcvbuWRnkPkfzd3x4WDmV2+puzy+s=; b=QUq0OeRuJi4oXnGB1jQd4jqTwc39c2eHMJ3SxtM0b1IiYbNV0fyBIkZ9YrwQpAYx4KR8gs rM4pdS6XJ6PAfQSNtWzkbVImYRAVbRANEbunQVftCRntNOEG7Mz0phBiwN9iFvKonbIC9R wJyDf8DttYpmwQhUV48D7HGMHeMiimUFcQcQz/VPjlWQ/XzUoTQG2lHwgczVOjq+nAgQ9W HLBbHl8jQuPiVdl7Q65tQGUYpkWzms1bQyH1RgTIL/LuKqNk2dxeSbT8FIBrN9i+gchrS4 ythX1b+R9JhSjrMmcpv/lLa3avNkqf5FYUG+U6dxZq7s1sIKlGMzwQUfVu9Y6w== 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 4X8c3G2X37z170d; Thu, 19 Sep 2024 13:35:38 +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 48JDZcxt053931; Thu, 19 Sep 2024 13:35:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JDZcmL053928; Thu, 19 Sep 2024 13:35:38 GMT (envelope-from git) Date: Thu, 19 Sep 2024 13:35:38 GMT Message-Id: <202409191335.48JDZcmL053928@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 417e81a40091 - releng/13.3 - libnv: correct the calculation of the structure's size 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 417e81a40091f7744c55139bfcad093c75426229 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=417e81a40091f7744c55139bfcad093c75426229 commit 417e81a40091f7744c55139bfcad093c75426229 Author: Mariusz Zaborski AuthorDate: 2024-09-11 14:43:43 +0000 Commit: Gordon Tetlow CommitDate: 2024-09-19 13:12:37 +0000 libnv: correct the calculation of the structure's size Reported by: Milosz Kaniewski Approved by: so Security: FreeBSD-SA-24:16.libnv Security: CVE-2024-45287 (cherry picked from commit 7f4731ab67f1d3345aee6626eb83cc5ce00010f0) (cherry picked from commit 056c50c48be3e3828ef740d2fcce988a545e52aa) (cherry picked from commit d84fced6b468a637b5a47bad747730fa344d68d8) --- sys/contrib/libnv/nvlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index e399d610a7ce..6934da0df00a 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -1029,7 +1029,7 @@ static bool nvlist_check_header(struct nvlist_header *nvlhdrp) { - if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(nvlhdrp)) { + if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(*nvlhdrp)) { ERRNO_SET(EINVAL); return (false); }