]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
libsa: Fix infinite loop in bzipfs & gzipfs
authorDavid Bright <dab@FreeBSD.org>
Mon, 24 May 2021 17:12:15 +0000 (12:12 -0500)
committerDavid Bright <dab@FreeBSD.org>
Wed, 9 Jun 2021 16:11:01 +0000 (11:11 -0500)
commit3045f4aa1a2b5f524e52297bb9a4fa6a2d4ac9ab
tree37ea22b0a1625144bc4b25e1020564c739010abb
parent71b88ee39fc6427b6353e9210710a947a27f383f
libsa: Fix infinite loop in bzipfs & gzipfs

A bug in the loader's bzipfs & gzipfs filesystems caused compressed
kernel and modules not to work on EFI systems with a veriexec-enabled
loader. Since the size of files in these filesystems are not known
_a priori_ `stat` would initialize the size to -1 and the loader would
then hang in an infinite loop while trying to seek (read) to the end
of file since the loop termination condition compares the current
offset to that negative target position.

Sponsored by: Dell EMC Isilon

(cherry picked from commit 3df4c387d2e3ca4c2391fb837540b048f60a11c2)
stand/libsa/bzipfs.c
stand/libsa/gzipfs.c