Page MenuHomeFreeBSD

Add root directory entry check.
ClosedPublic

Authored by fsu on Feb 11 2023, 7:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 5, 6:52 PM
Unknown Object (File)
Tue, Nov 5, 6:52 PM
Unknown Object (File)
Oct 1 2024, 12:29 AM
Unknown Object (File)
Oct 1 2024, 12:29 AM
Unknown Object (File)
Sep 30 2024, 10:26 PM
Unknown Object (File)
Sep 7 2024, 11:59 PM
Unknown Object (File)
Sep 2 2024, 11:10 AM
Unknown Object (File)
Aug 24 2024, 6:46 PM
Subscribers

Details

Summary

Add check that directory entry with ino=EXT2_ROOTINO have correct namelength and name. It is possible to create malicious image which will cause panic if root directory entry have incorrect name.

Fix: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259068

Test Plan

ext2fs does not panic on malicious image from 259068

Diff Detail

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

Event Timeline

fsu requested review of this revision.Feb 11 2023, 7:39 AM

I think this is the first time I have seen a char string return value. Can we keep the same coding style as in ext2_check_direntry() ?
That is .. assigning error_msg within the function instead of returning it.

Ok, let's remove ext2_check_root_direntry() completely.

This revision is now accepted and ready to land.Feb 18 2023, 7:02 PM
This revision was automatically updated to reflect the committed changes.