Date: Fri, 10 Apr 2020 05:13:16 +0000 (UTC) From: "Simon J. Gerraty" <sjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r359769 - stable/12/stand/liblua Message-ID: <202004100513.03A5DGt9090744@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sjg Date: Fri Apr 10 05:13:15 2020 New Revision: 359769 URL: https://svnweb.freebsd.org/changeset/base/359769 Log: veloader use vectx API for kernel and modules The vectx API, computes the hash for verifying a file as it is read. This avoids the overhead of reading files twice - once to verify, then again to load. For doing an install via loader, avoiding the need to rewind large files is critical. This API is only used for modules, kernel and mdimage as these are the biggest files read by the loader. The reduction in boot time depends on how expensive the I/O is on any given platform. On a fast VM we see 6% improvement. For install via loader the first file to be verified is likely to be the kernel, so some of the prep work (finding manifest etc) done by verify_file() needs to be factored so it can be reused for vectx_open(). For missing or unrecognized fingerprint entries, we fail in vectx_open() unless verifying is disabled. Otherwise fingerprint check happens in vectx_close() and since this API is only used for files which must be verified (VE_MUST) we panic if we get an incorrect hash. MFC of r358811 Reviewed by: imp,tsoome Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org//D23827 Modified: stable/12/stand/liblua/lstd.c Modified: stable/12/stand/liblua/lstd.c ============================================================================== --- stable/12/stand/liblua/lstd.c Fri Apr 10 01:37:00 2020 (r359768) +++ stable/12/stand/liblua/lstd.c Fri Apr 10 05:13:15 2020 (r359769) @@ -83,7 +83,7 @@ fopen(const char *filename, const char *mode) #ifdef LOADER_VERIEXEC /* only regular files and only reading makes sense */ if (S_ISREG(st.st_mode) && !(m & O_WRONLY)) { - if (verify_file(fd, filename, 0, VE_GUESS) < 0) { + if (verify_file(fd, filename, 0, VE_GUESS, __func__) < 0) { free(f); close(fd); return (NULL);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004100513.03A5DGt9090744>