Page MenuHomeFreeBSD

pseudofs: Fix a potential out-of-bounds access in pfs_lookup()
ClosedPublic

Authored by markj on Jun 21 2023, 2:05 PM.
Tags
None
Referenced Files
F152917535: D40692.diff
Sat, Apr 18, 1:03 AM
Unknown Object (File)
Wed, Apr 15, 10:53 AM
Unknown Object (File)
Tue, Apr 14, 3:11 AM
Unknown Object (File)
Mar 16 2026, 6:20 PM
Unknown Object (File)
Mar 10 2026, 4:46 PM
Unknown Object (File)
Mar 2 2026, 8:31 AM
Unknown Object (File)
Mar 2 2026, 2:30 AM
Unknown Object (File)
Feb 21 2026, 3:04 PM
Subscribers

Details

Summary

pseudofs nodes store their name in a flexible array member, so the node
allocation is sized using the length of the name, including a nul
terminator. pfs_lookup() scans a directory of nodes, comparing names to
find a match. The comparison was incorrect and assumed that all node
names were at least as long as the name being looked up, which of course
isn't true.

I believe the bug is mostly harmless since it cannot result in false
positive or negative matches from the lookup, but it triggers a KASAN
check.

Reported by: pho

Diff Detail

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