]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Clear non-x86 compat stat syscall kernel stack memory disclosure
authorEd Maste <emaste@FreeBSD.org>
Tue, 29 Mar 2022 17:55:21 +0000 (13:55 -0400)
committerEd Maste <emaste@FreeBSD.org>
Tue, 29 Mar 2022 20:10:04 +0000 (16:10 -0400)
commitf90cd1ae30b5f49e9f6ea58a0628ce1c8d8822bc
tree23dcdf56a830fc9531963ff68d3ab2f00427ff92
parente123e2294cb50deb288916b79a8c05a006f8bca3
Clear non-x86 compat stat syscall kernel stack memory disclosure

32-bit architectures other than i386 have 64-bit time_t which results
in a struct timespec with 12 bytes for tv_sec and tv_nsec, and 4 bytes
of padding.  Zero the padding holes in struct stat32 and struct
freebsd11_stat32.

i386 has 32-bit time_t; struct timespec is 8 bytes and has no padding.

Found by inspection, prompted by a report by Reno Robert of Trend Micro
Zero Day Initiative.  The originally reported issue (ZDI-CAN-14538) is
already fixed in all supported FreeBSD versions (it was addressed
incidentally as part of the 64-bit inode project).

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34709
sys/compat/freebsd32/freebsd32_misc.c