Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 35572 Build 32472: arc lint + arc unit
Event Timeline
LGTM. I wonder why we ended up with these - in the case of itimerspec, sigevent etc. were the structs identical?
For itimerspec, I think they differ on any 32-bit non-i386 port (other than x32 or riscv32 were they to exist in FreeBSD) where we have a 64-bit time_t and Linux doesn't. The sigevents differ in layout (e.g. the first three fields are permuted). We just never notice these due to passing them directly to copyin/copyout and thus they're all implicitly cast to void *, with the length argument being based on sizeof(kernel_var) instead, so we (accidentally?) do the right thing.
We notice these downstream in CheriBSD because we have a __USER_CAP_OBJ(ptr) to turn a legacy userspace pointer (integer) into a capability, and it automatically uses sizeof(*ptr) as the length (as a friendlier version of __USER_CAP which takes an explicit length), so if the syscall prototypes are wrong we get the wrong length (which either means we don't enforce bounds as strictly as we'd like in the kernel due to the length being too large, or we end up faulting when copying in/out due to the length being too small).