From nobody Thu Nov 05 19:33:01 2026 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 4jLCC14rTDz6y3GT for ; Thu, 05 Nov 2026 19:33:01 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jLCC13JMqz3KS1 for ; Thu, 05 Nov 2026 19:33:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793907181; 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=OgEF+5F6AwF0BCKcfYT2uMUtw7+FyEPVjTIDCYuUKeo=; b=NEfSbU3Ih1CUbXzteOwwvhxJxgLwrUDLzR6+RajlzJWiyrJLhd/G2Aaz9g6fwPWB9/e4g5 pX2PYcpX+/D/n8hMz5uJR9V8BSeV9KZVcET+MgO6mvTSUnT/wmgqGBYpauj0pmJGR9xe7R 5KORfEoOZdQgBL2MtAG12ZAsMr0I8SkmW1Mi9/ZtRVoUKzXRIJl6/6uuyq/Z4KERK22I96 5T7L7iDdAVRcKKnO75tJdgCwuMhd73uy8eNNT6C7cxfTL2bnBFvZVBpusDCmFUviIw0gp1 Jgcy2Ft6qmgTJgesyVHvGuBmC7By6DPSWgTYBvr4YLqWN5rw3CeH3l6K1Ah+sQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793907181; b=s7/mjvwlI2voQR70aYrGcHpxyZW11lkjmoEEk/QS/hdBA5pPrJhG9zMqHZ3xsHTnhrjzNi Q+b+JswuSeQUT+5HtfpZgwSS+oY6xpOFUZZOOtslKZU9l80/gsHY22wNdYmPPuJrItmM+T XlPFdz9TQGQ9YK7B279NyWA12JgXiztl5bqG6aTFfTd99B3rUAuWE6cr+lhhj+NZBkhkgp C9Htds1bNFfllCfWz25Obi6XD3hOglaS36fSlYXY4AMxwbuNkjjMiVag8HoBAdKqizdf17 JzhA30Fba0zcY6DBYDD7YlPnhEcTH8PJUzEiiA460jUDKCelCasEpI7hdalQhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793907181; 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=OgEF+5F6AwF0BCKcfYT2uMUtw7+FyEPVjTIDCYuUKeo=; b=B0Hetn8gscfpQFnnF6T9H+5Z+qW2J0TpLzxZZRxsE+vckZpVWa5aCebbswrby2cAYCoWdw fuN0Zl94hwYpXZ2SdFn1zymzQ662rGwXqILPVTjOJAGS3xyEVWLnlFxeV4aPofn81uMRsr Dl8OFdtNa5Bj2AWtkaMyuMJ+NFmKvbApsoG90/JErPxkcKzmJV74SgVY952PBiyWPn4KwL lzJDqyHyVAsUqE0dKg5QT8rcwiWTAHp71PeZwyKhHr3Ijt/YV4BUrE4uZOQhfXET8+9+9H R26qpeZwZss7LgxYjfxDI6SIAMfqHk8icc3K2UcqkImqZdJNYXxBsSxlyDt2pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jLCC12yw5z141k for ; Thu, 05 Nov 2026 19:33:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4770f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 05 Nov 2026 19:33:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 9d5a02e961ca - stable/15 - tarfs: Fix length calculation for file read List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository 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: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 9d5a02e961caccd8bac789a3e495f35b46f987f3 Auto-Submitted: auto-generated Date: Thu, 05 Nov 2026 19:33:01 +0000 Message-Id: <6aecd9ed.4770f.5e463b47@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=9d5a02e961caccd8bac789a3e495f35b46f987f3 commit 9d5a02e961caccd8bac789a3e495f35b46f987f3 Author: Dag-Erling Smørgrav AuthorDate: 2026-11-02 12:29:25 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-11-05 17:45:27 +0000 tarfs: Fix length calculation for file read When the offset is within a block rather than at its beginning, the length should be clamped to the remaining length of the block, not its total length. Reported by: n0ps1ed MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D60904 (cherry picked from commit 18bce6e65cdf059618ff12ace82a9f7334e1b610) --- sys/fs/tarfs/tarfs_subr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/fs/tarfs/tarfs_subr.c b/sys/fs/tarfs/tarfs_subr.c index 180e0a53f8b9..0cb5eec8c385 100644 --- a/sys/fs/tarfs/tarfs_subr.c +++ b/sys/fs/tarfs/tarfs_subr.c @@ -428,7 +428,7 @@ tarfs_read_file(struct tarfs_node *tnp, size_t len, struct uio *uiop) TARFS_DPF(VNODE, "%s(%s, %zu, %zu)\n", __func__, tnp->name, uiop->uio_offset, resid); for (i = 0; i < tnp->nblk && resid > 0; ++i) { - if (uiop->uio_offset > tnp->blk[i].o + tnp->blk[i].l) { + if (uiop->uio_offset >= tnp->blk[i].o + tnp->blk[i].l) { /* skip this block */ continue; } @@ -456,7 +456,8 @@ tarfs_read_file(struct tarfs_node *tnp, size_t len, struct uio *uiop) while (resid > 0 && uiop->uio_offset < tnp->blk[i].o + tnp->blk[i].l) { /* now actual data */ - copylen = tnp->blk[i].l; + copylen = tnp->blk[i].l - + (uiop->uio_offset - tnp->blk[i].o); if (copylen > resid) copylen = resid; auio = *uiop;