From nobody Wed Jun 10 13:52:30 2026 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 4gb6fQ6fWWz6gS6q for ; Wed, 10 Jun 2026 13:52:30 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gb6fQ1Qt0z3PHh for ; Wed, 10 Jun 2026 13:52:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781099550; 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=t+h96kbHWf5nPN7DxaLcMp3mzZ8BRqUT5TmvKtDMITg=; b=HHBBDuMvn/p7Vdi3LKSrHyAfPalEMzjxok//cHOJdiSllCLYIJeBl1mDM3NHnNZzSsvTkp AuU8GJjwE0vJaIk7f+Mh4jmcBX57BHedfhDTW9KDjs0JlcYBTeOrjsAI1Nsj7f1pTE5po2 RjbpLB87Piv9L4cqxFgz6lfT7b65xwTyzHNWnTqJTrHv4nXlFSksce5Z2Dwdp7ROk4jSWG APlSJdInfcgsK29cB23ueJ/u3+qiFL7mPo9vNFRAC/9YYmgSD/ntOcATeo/MafMlsRMD1p cQNS6+45HYLwpI4Se11IDIjFveJ+VIeZtb2ivfR7zEoXQxv8CdNjnN5zL1JfHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781099550; a=rsa-sha256; cv=none; b=o1Eo19BgwrqUM6RYTQCYHB7VGhktcfisO0Q0MYGkKdTmcZpvlUXY/N4FM+sRSPiGrqe/5w ri1TShGh65hzc0g62led0Et7HkLeH44r1R9UTWjFPLdZGgPKAuslVJQC4iCMHx+DbRck5y MnYgLJbfvc8JL8wPoGh1JHUe0unDnOwhdZTU/mtGLQjG2ze79d+lQWnz4ligypt9USsePA DoxjlguOlltaOK70AEqy96goBEXOD9ovcaHYKMwTYoDzhm3h2NJz06qvA5WBl/0pdHi9g2 etaQnTasXXRuGlM84sWFP6DWBeVLv8H+ycGxSSDRiNPthqXOH7Zm4lx8uRkGhw== 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=1781099550; 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=t+h96kbHWf5nPN7DxaLcMp3mzZ8BRqUT5TmvKtDMITg=; b=I1BQABReX7Va+7EZ+bvooDTQCBilnmfsdW2g4CenMbVDNK+eyW4An0g886jMNPu/g8q2SO UdI11ct3YDYcFZGQTvLKG1hh4nYN+xZTTZjkfO7k7nBEf1r8mk8f04kKFLVz1rSmgzfMMk 0OallPLN1JnI0Mf5tgaomNtv2NR8h5p+8MQ9nmSQszKitdUPUd1oufq1Xp/zsnNud8lFIu wMPivdAgQtifrVYcTjPTUoYhIkMemZCJ00cR6Q2d7QciozwDB5zhG2TRfLvyWIf1u7jFmh ktOx/Gv2HkubdaL6tTuIIwpnBUBVOLpGOBUyHQw+/ZJqQZ8pyeBVdXYc4AMUjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gb6fQ10Gqz1MZD for ; Wed, 10 Jun 2026 13:52:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f802 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 10 Jun 2026 13:52:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 0492dbe9212e - main - cd9660: Don't parse RRIP records whose length overflows the sector boundary 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 List-Id: 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0492dbe9212ee0172e8003c487f256015478edd6 Auto-Submitted: auto-generated Date: Wed, 10 Jun 2026 13:52:30 +0000 Message-Id: <6a296c1e.1f802.270eebf0@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0492dbe9212ee0172e8003c487f256015478edd6 commit 0492dbe9212ee0172e8003c487f256015478edd6 Author: John Baldwin AuthorDate: 2026-06-10 13:44:10 +0000 Commit: John Baldwin CommitDate: 2026-06-10 13:44:10 +0000 cd9660: Don't parse RRIP records whose length overflows the sector boundary PR: 272896 Reported by: Robert Morris Reviewed by: des, emaste Differential Revision: https://reviews.freebsd.org/D57135 --- sys/fs/cd9660/cd9660_rrip.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/sys/fs/cd9660/cd9660_rrip.c b/sys/fs/cd9660/cd9660_rrip.c index 9bc8ef655368..db87f6d1223e 100644 --- a/sys/fs/cd9660/cd9660_rrip.c +++ b/sys/fs/cd9660/cd9660_rrip.c @@ -464,6 +464,7 @@ cd9660_rrip_loop(struct iso_directory_record *isodir, ISO_RRIP_ANALYZE *ana, RRIP_TABLE *ptable; ISO_SUSP_HEADER *phead; ISO_SUSP_HEADER *pend; + ISO_SUSP_HEADER *pnext; struct buf *bp = NULL; char *pwhead; u_short c; @@ -495,6 +496,21 @@ cd9660_rrip_loop(struct iso_directory_record *isodir, ISO_RRIP_ANALYZE *ana, * Note: "pend" should be more than one SUSP header */ while (pend >= phead + 1) { + /* Validate length. */ + if (isonum_711(phead->length) < sizeof(*phead)) + break; + + /* + * Next SUSP + * Hopefully this works with newer versions, too + */ + pnext = (ISO_SUSP_HEADER *)((char *)phead + + isonum_711(phead->length)); + + /* If the record doesn't fit, break out of the loop. */ + if (pnext > pend) + break; + if (isonum_711(phead->version) == 1) { for (ptable = table; ptable->func; ptable++) { if (phead->type[0] == ptable->type[0] && @@ -510,14 +526,8 @@ cd9660_rrip_loop(struct iso_directory_record *isodir, ISO_RRIP_ANALYZE *ana, result &= ~ISO_SUSP_STOP; break; } - /* plausibility check */ - if (isonum_711(phead->length) < sizeof(*phead)) - break; - /* - * move to next SUSP - * Hopefully this works with newer versions, too - */ - phead = (ISO_SUSP_HEADER *)((char *)phead + isonum_711(phead->length)); + + phead = pnext; } if (ana->fields && ana->iso_ce_len) {