Page MenuHomeFreeBSD

syscalls.master: switch to CAPENABLED flags
ClosedPublic

Authored by brooks on Jul 29 2021, 8:59 PM.
Tags
None
Referenced Files
F102079198: D31350.id.diff
Thu, Nov 7, 8:58 AM
Unknown Object (File)
Mon, Nov 4, 12:40 PM
Unknown Object (File)
Mon, Oct 14, 8:13 PM
Unknown Object (File)
Oct 4 2024, 11:24 AM
Unknown Object (File)
Oct 4 2024, 11:24 AM
Unknown Object (File)
Oct 4 2024, 11:23 AM
Unknown Object (File)
Oct 4 2024, 9:22 AM
Unknown Object (File)
Oct 4 2024, 6:00 AM
Subscribers

Details

Summary

Switch the main syscall table to use CAPENABLED flags rather than
capabilities.conf. This avoid synchronization issues between
syscalls.master and capabilities.conf (e.g. when renaming a syscall
during development).

For now, move capabilities.conf to sys/compat/freebsd32 and use it
there. Use of sys/compat/freebsd32/syscalls.master should be replaced
by makesyscalls.lua enhancements to allow the main one to be used.

This change results in no changes to generated files after running
make sysent.

MFC after: 1 week
Sponsored by: DARPA

Test Plan

make sysent results in no changes.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

(I've looked at up to 166)

sys/kern/syscalls.master
194

This one was not enabled in capabilities.conf I believe? Although that might have been accidental I might argue for keeping it out (assuming I haven't missed something).

300

There are some comments in capabilities.conf that will be lost, perhaps we should move them here? e.g. ## Do allow sync(2) for now, but possibly shouldn't.

(Although perhaps some of the questions/XXXs have been resolved since.)

315

And comments like

## XXXRW: getpgid(2) needs scoping.  It's not clear if it's worth scoping
## getppid(2).  getpriority(2) needs scoping.  getrusage(2) needs scoping.
## getsid(2) needs scoping.
351

this one also not in capabilities.conf? (and the other COMPAT entries)

477

XXXRW: Kernel doesn't implement this, so drop?

978

freebsd 4 fstatfs was not included

1113

(this one was explicitly enabled in capabilities.conf before)

Note: this was tested by running make sysent and verifying that nothing changed.

@rwatson might want to review the capabilities.conf XXXRW comments and see which ones should be pulled across.

sys/kern/syscalls.master
194

It's there as lseek (I added support for matching names without o or freebsd#_ prefixes a while ago.)

That being said, I think there's an argument we should remove all the COMPAT ones prior to FreeBSD 9 since no non broken program could be calling them in capability mode. I'd prefer to do that in a separate commit and due to the feature above it can't easily be done prior to this commit.

477

This one is probably with dropping. The whole syscall should have been dropped ages ago. It should become freebsd13_sstk at some point.

sys/kern/syscalls.master
194

OK, as a second commit sounds good to me.

Please include in the commit message the note wrt no change in generated files from make sysent

This revision is now accepted and ready to land.Aug 4 2021, 2:53 PM

capabilities.conf is still in the tree so the XXXRW comments still exist somewhere - we can make sure they make it into syscalls.master or somewhere appropriate before handling compat32

This revision now requires review to proceed.Sep 1 2021, 6:11 PM
  • Handle fspacectl
  • Add a note that there is no functional change
This revision is now accepted and ready to land.Sep 1 2021, 6:53 PM
This revision was automatically updated to reflect the committed changes.