Page MenuHomeFreeBSD

cd9660: Add various length checks when parsing RRIP extensions
ClosedPublic

Authored by jhb on May 20 2026, 7:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 29, 10:53 PM
Unknown Object (File)
Sat, Jun 27, 4:10 AM
Unknown Object (File)
Fri, Jun 26, 11:07 AM
Unknown Object (File)
Fri, Jun 26, 1:04 AM
Unknown Object (File)
Thu, Jun 25, 10:51 AM
Unknown Object (File)
Thu, Jun 25, 9:27 AM
Unknown Object (File)
Wed, Jun 24, 7:43 AM
Unknown Object (File)
Wed, Jun 24, 5:12 AM
Subscribers

Details

Summary

Pass the length of a RockRidge attribute to the handler functions and
validate that length in each handler. If a parsing error is detected,
abort the entire parsing pass.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.May 20 2026, 7:09 PM

While the previous patch in this stack fixes a reproducer from Robert, this followup patch is intended as additional robustness. With both of these I was able to still mount a FreeBSD install CD and all of the attributes reported by find /mnt -ls were the same before and after the patches.

des added inline comments.
sys/fs/cd9660/cd9660_rrip.c
146–155

why is this not the loop initialization?

sys/fs/cd9660/cd9660_rrip.c
521–524

Ought to have the check before p->len_id above

sys/fs/cd9660/cd9660_rrip.c
146–155

Because it isn't the thing being iterated (pcomp) which would be the normal thing to set in the initializer. This is more like a TAILQ_FOREACH_SAFE(). The assignment here is more to pacify the compiler, but it isn't needed as the loop body always initializes pcompn before it can be used in the last clause. I haven't actually tried building without this assignment, perhaps modern compilers are smart enough to not warn?

521–524

Oops, yes.

modulo fix for the issue @emaste raised

This revision is now accepted and ready to land.Jun 5 2026, 4:20 PM
This revision now requires review to proceed.Jun 10 2026, 2:12 PM
This revision was not accepted when it landed; it landed in state Needs Review.Mon, Jun 22, 4:47 PM
This revision was automatically updated to reflect the committed changes.