Page MenuHomeFreeBSD

stand: Add a call to verify_file from ficl.
AbandonedPublic

Authored by mindal_semihalf.com on May 23 2019, 10:01 AM.

Details

Reviewers
sjg
mw
Summary

Without it those files are loaded bypassing verification when using forth interpreter.

Test Plan

Run loader with forth interpreter and veriexec enabled and make sure that all loaded files including *.conf are checked by verify_file.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

sjg added inline comments.May 23 2019, 7:45 PM
stand/ficl/loader.c
506

Hmm this is in our internal tree, not sure how I missed it.
Note I have:

if (fd >= 0 && (mode & 0x3) == 0 &&
      verify_file(fd, name, 0, VE_GUESS) < 0) {
      close(fd);
      fd = -1;
}
sjg added a comment.May 23 2019, 7:53 PM

Actually it would be better to call verify_file and THEN consider mode.
If the file is verified writing should not be allowed, if it is not verified reading should not be allowed.

sjg added a comment.May 23 2019, 8:12 PM

Ok I never committed my changes to loader.c because I had some other junk in there so it would work with Junos - for testing.
See
https://reviews.freebsd.org/D20387

for what I described

Ok, I'm abandoning this in favor of your patch.