A handful of the newer syscalls we've been adding (sched_setattr/sched_getattr, bpf, soon openat2) use versioned, extensible structs, where the kernel can add fields at the end of the struct, and earlier kernels validate that any unknown fields are zeroed out.
Linux has a single helper that's used kernel-wide, copy_struct_from_user(), for these syscalls. Currently, gVisor handles this on an ad-hoc basis.
At some point we should make a generic API for this and update all the call sites.
A handful of the newer syscalls we've been adding (sched_setattr/sched_getattr, bpf, soon openat2) use versioned, extensible structs, where the kernel can add fields at the end of the struct, and earlier kernels validate that any unknown fields are zeroed out.
Linux has a single helper that's used kernel-wide, copy_struct_from_user(), for these syscalls. Currently, gVisor handles this on an ad-hoc basis.
At some point we should make a generic API for this and update all the call sites.