opnsense-src/sys/fs/pseudofs
Mark Johnston fc915f1be1 pseudofs: Fix a potential out-of-bounds access in pfs_lookup()
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
Reviewed by:	kib, Olivier Certner <olce.freebsd@certner.fr>
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40692
2023-06-23 09:54:39 -04:00
..
pseudofs.c sys/fs: do not report blocks allocated for synthetic file systems 2023-04-25 09:59:15 +02:00
pseudofs.h pseudofs: Microoptimize struct pfs_node 2023-04-02 11:20:07 +03:00
pseudofs_fileno.c sys/fs: further adoption of SPDX licensing ID tags. 2017-11-27 15:15:37 +00:00
pseudofs_internal.h pseudofs: Allow vis callback to be called for a named node 2023-04-02 11:21:15 +03:00
pseudofs_vncache.c vfs: add the concept of vnode state transitions 2022-12-26 17:35:12 +00:00
pseudofs_vnops.c pseudofs: Fix a potential out-of-bounds access in pfs_lookup() 2023-06-23 09:54:39 -04:00