util/os_file: always use the 'grow' mechanism
Use fstat() only to pre-allocate a big enough buffer. This fixes a race where if the file grows between fstat() and read() we would be missing the end of the file, and if the file slims down read() would just fail. Fixes: 31696470 "util: add os_read_file() helper" Reported-by:Jason Ekstrand <jason@jlekstrand.net> Signed-off-by:
Eric Engestrom <eric.engestrom@intel.com> Reviewed-by:
Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit 22c1657d)
Loading
Please register or sign in to comment