Page MenuHomeFreeBSD

stand: Add a call to verify_file from ficl.
AbandonedPublic

Authored by kd on May 23 2019, 10:01 AM.
Tags
None
Referenced Files
F81619217: D20373.diff
Fri, Apr 19, 2:02 AM
Unknown Object (File)
Jan 27 2024, 3:18 AM
Unknown Object (File)
Dec 20 2023, 3:02 AM
Unknown Object (File)
Sep 12 2023, 9:57 AM
Unknown Object (File)
Aug 20 2023, 4:41 PM
Unknown Object (File)
Jun 30 2023, 12:02 PM
Unknown Object (File)
Jan 23 2023, 3:09 PM
Subscribers

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
Tests Skipped

Event Timeline

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;
}

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.

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.