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)
Sun, Apr 28, 11:44 PM
Unknown Object (File)
Fri, Apr 26, 1:12 PM
Unknown Object (File)
Jan 14 2024, 7:25 AM
Unknown Object (File)
Dec 20 2023, 6:37 AM
Unknown Object (File)
Dec 13 2023, 11:52 AM
Unknown Object (File)
Nov 28 2023, 2:50 PM
Unknown Object (File)
Nov 23 2023, 2:34 PM
Unknown Object (File)
Sep 18 2023, 2:26 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.