From nobody Wed Mar 06 16:24:31 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 4Tqd735WBDz5Csd6; Wed, 6 Mar 2024 16:24:31 +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 4Tqd732MqMz4fGQ; Wed, 6 Mar 2024 16:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709742271; 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=hWY9JqOxzydnxiwKFTgAU+6KQOtawRzny0ppUDzX0R0=; b=Qdoy073SLHVuKSyQAgU+DWUgCIX84dJiKC+hiBde1VX8sexQPY+N9O4VWteB7ee8HknJeT 01sVNCOD7XMVSNJBuvPKkmtU091IP4QsZvUDMUyCIYUhBCJturmgEcMejH2IMGI/ughZuL 5pJPjNk/Qlr67EDpjYJSUcjLdKwR0GgFEXnGKmmhrJCKkNOBnOYQ+3ovGOElDV/6nGeN3L U14W3n/xeON3XTxv6fjQOc36KZuO3WO07IiQy4sbWQ+mfO9aHQ+wp46dWOPk7nAmmo9uLZ FlZE4SvHBtSxKzH+3fz43GdLdWimPJOL6mCgUwUySPbFmdhjgZ5I2oqUWFb68A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709742271; a=rsa-sha256; cv=none; b=f+BJ4Rf17QOS1YM0wTRu13t7OcfC381f/WtYXD5uHwUuB4Ykpu2SjZycg6a1zQuJGZM025 Pkl/j0xphLR2ZUVnT7tJN3JIyYwkWzBUb/6MNNB5KSqlkLIKfuWcPaEIPRDQK9m1SWs1wc KxJfzriygyaQu2q5FbKBIgX4vnA1Kwnd/jvbLQBosJXHjROxNjXB0Ksh7738GvGSdHll1Y QhjbvXoKSN8niEYxf55JIz2itYvY/CR/e5tcZnnsDpfFRw/rVa+xgkNJW3FeTmTXP4bY72 iay8f5VF4tKS7NujgDZEVJHvPTDLQ1ry/0M0KOyV1vce9UJc3Rb1W1PzlCRYfQ== 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=1709742271; 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=hWY9JqOxzydnxiwKFTgAU+6KQOtawRzny0ppUDzX0R0=; b=fgqiFrnEFNoQ1b6mhccMTOIJrYzx87pRARgdpslPXqT0FZ7SBUJYTbYNRjPvcDdrQV+6Cw 4s6c2oAHiawMPBE335L7G0eEbA/R/NQ0EwItjfwMna8gvOodYipeJC9KcR1G9OdTzrEVW8 VXZyZVnTzW2PHZSuzIC2MrhMSW1/YlkwYXperbq9tHURtok8/QVelbCV4l7qDMMO8rWESj rHcbhuNGqFD/ZHf64zX4ekgxAPExBijUBvgNL+7EglEPb17c8Zx40DSd7dxAAVNGbHpRrr LlIS6G+ts3aOaKXD0KpiiqKihnWHBKOSeXc4ocCKQLWVJ4o7YdfHpc9Ro2JqMA== 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 4Tqd731yKtzx0h; Wed, 6 Mar 2024 16:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 426GOVHt025116; Wed, 6 Mar 2024 16:24:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 426GOV5v025113; Wed, 6 Mar 2024 16:24:31 GMT (envelope-from git) Date: Wed, 6 Mar 2024 16:24:31 GMT Message-Id: <202403061624.426GOV5v025113@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: c291b7914e1d - main - tarfs: Avoid overflow in exthdr calculation. 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: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c291b7914e1db9469cc820abcb1f5dde7a6f7f28 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c291b7914e1db9469cc820abcb1f5dde7a6f7f28 commit c291b7914e1db9469cc820abcb1f5dde7a6f7f28 Author: Dag-Erling Smørgrav AuthorDate: 2024-03-06 16:13:54 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-03-06 16:13:54 +0000 tarfs: Avoid overflow in exthdr calculation. MFC after: 3 days PR: 277420 Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44202 --- sys/fs/tarfs/tarfs_vfsops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/fs/tarfs/tarfs_vfsops.c b/sys/fs/tarfs/tarfs_vfsops.c index df8ad240d032..05014bf10373 100644 --- a/sys/fs/tarfs/tarfs_vfsops.c +++ b/sys/fs/tarfs/tarfs_vfsops.c @@ -583,7 +583,8 @@ again: error = EINVAL; goto bad; } - if (line + len > exthdr + sz) { + if ((uintptr_t)line + len < (uintptr_t)line || + line + len > exthdr + sz) { TARFS_DPF(ALLOC, "%s: exthdr overflow\n", __func__); error = EINVAL;