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
F160645541: D57136.id180309.diff
Fri, Jun 26, 11:07 AM
F160596335: D57136.id180309.diff
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
Unknown Object (File)
Fri, Jun 19, 2:26 PM
Unknown Object (File)
Fri, Jun 19, 3:21 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 73292
Build 70175: arc lint + arc unit

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

why is this not the loop initialization?

sys/fs/cd9660/cd9660_rrip.c
517–520

Ought to have the check before p->len_id above

sys/fs/cd9660/cd9660_rrip.c
146

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?

517–520

Oops, yes.

modulo fix for the issue @emaste raised

This revision is now accepted and ready to land.Fri, Jun 5, 4:20 PM
This revision now requires review to proceed.Wed, Jun 10, 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.