From nobody Sun Sep 15 15:00:03 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 4X6B6X0W1Cz5WmWs; Sun, 15 Sep 2024 15:00:04 +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 4X6B6W4sxWz4NyY; Sun, 15 Sep 2024 15:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726412403; 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=ay8gih3zjfZ9CYxDFUZcGd9gpsTs5NS19epZG3YyWs8=; b=Rq8MiDHg2qQtKVRwxvvwMbDC6lwjDldHN5SI+dz99fhwjdK9pyL9r2rfJwEdXw/E3KoPBf rZwPFfh7Edr0s/GYf7s+nRsXTxmhDB//rxylB9PyFDPMmwVjLAZyO9+jcCK8c1V7SKu+bY xz2GHTzqWlKeqGpp/e1THydSZ0yGAOzwx0UmS+lIfHwsaCQAwWp3X7hze/0F/Eh0Se+QoH jJbPGl+Bxhxc4usTyev1ZbrwF0NBOURjni8hWdnFvLMRqRri25c8x4UQbn+hTo1+90aMDt nRax3y0AD6gSPRytlmhYghnxaOnyY7AdLp7qY768owG8KI8bU8J3dTJXhVHNkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726412403; a=rsa-sha256; cv=none; b=WTNV2u9h9ns0gF0iil/oOUxJQkb51YeSGiJ+A5YrumJgq3jbWJbGhO+UCRAMD30oKh6lVx Zojg9MQWERq6zh2nAcbBN/DGlnY46UCgf13vOL+9yg4fKFAyjlQSdZE6zj5Gg/f3KDz5U9 ZLKC75W4h55S2uW0p/TNByxIoRd6owKqlzu3knkr8uffbHhyLc3R62OCVvH8pO6+csbmbs knd3xqx2bo+UNu95F20Qub6mHbMo1O+wiYXgOTJXLArWXipugX9aEg1ZiciVn3cJ/mfwf2 3x4ysOumRZtjtYeV/wZx3h6FhxAbOBpt9T17gzSa29MDWFymQNvXeonfNg0MBA== 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=1726412403; 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=ay8gih3zjfZ9CYxDFUZcGd9gpsTs5NS19epZG3YyWs8=; b=ervrKMjL3cOEgP/4PPeoCeeescTX53KP1kJ1E95mjOj6bOfuVv0hQnmSGjF+pv0Zz+HwOS X3u9VuH2ZKHMYyB3vY/njc6u8r7qG9+jEz7WVZyhrrvQnJGzFtTnjY6TNIsr2COt/sxMGU tVmh9zf+a/HZ2+iXcro8NySUtwTKedE/DsnRLvjjl8/y6LCLVrkYtTUGMJMB1GxjETHlvB Urd7RFIFKqDfoAdMooFBdyMoNSdsqLNMRaBXV5x/3f08AqOlBuAmKKPM9CFbyaK64LqrG/ Ewv4v51NM1656wrg3IlnPylAlj9RG4/QpcsOtA31rt09ZoIz7NxXM7fZfIGyHQ== 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 4X6B6W4TYbzFgd; Sun, 15 Sep 2024 15:00:03 +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 48FF03MS035456; Sun, 15 Sep 2024 15:00:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48FF03rk035450; Sun, 15 Sep 2024 15:00:03 GMT (envelope-from git) Date: Sun, 15 Sep 2024 15:00:03 GMT Message-Id: <202409151500.48FF03rk035450@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: d84fced6b468 - stable/13 - 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d84fced6b468a637b5a47bad747730fa344d68d8 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d84fced6b468a637b5a47bad747730fa344d68d8 commit d84fced6b468a637b5a47bad747730fa344d68d8 Author: Mariusz Zaborski AuthorDate: 2024-09-11 14:43:43 +0000 Commit: Ed Maste CommitDate: 2024-09-15 14:59:51 +0000 libnv: correct the calculation of the structure's size Reported by: Milosz Kaniewski (cherry picked from commit 7f4731ab67f1d3345aee6626eb83cc5ce00010f0) (cherry picked from commit 056c50c48be3e3828ef740d2fcce988a545e52aa) --- 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); }