Report namei path lookups while Capsicum violation tracing with CAPFAIL_NAMEI. vfs caching is also ignored when tracing to mimic capability mode behavior. Programs that are not yet Capsicumized may be traced to discover potential capability failures. With `ktrace -t p` and kdump, you are given a list of syscalls as a starting point for program Capsicumization.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/kern/vfs_lookup.c | ||
---|---|---|
243 |
It looks like cn_pnbuf is copied in using copyinstr(9) inside of namei_getpath(). A quick look at some copyinstr(9) assembly indicates that its return buffer will be nul-terminated upon success. namei_getpath() is called at the beginning of the namei() routine, so I'm pretty certain that cn_pnbuf should always be nul-terminated. |
sys/kern/vfs_lookup.c | ||
---|---|---|
243 | I should also note that it doesn't look like cn_pnbuf is modified anywhere, so its nul-terminator should never be overwritten. |
Comment Actions
Replace all instances of "AT_FDCWD" with "<AT_FDCWD>" when reporting a violation via ktrcapfail().
Comment Actions
- Record *namei* violations instead of vfs. Slight wording change for clarity.
- Rebase on main after several months