google / google/gvisor

Generic api for syscalls with versioned structs

Open
#14,074 0 comments 0 reactions 1 assignee Claimed by @relkochta View on GitHub
Dominant language
Go
Stars
19.3k
Forks
2k
Avg merge
3d 5h
Merged PRs (30d)
264

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.