When copying out struct statfs to userland, we need to zero out the fsid field unless it's root that's asking. This far, this has been done by putting a struct statfs on the stack and modifying it.
When copying out struct statfs to userland, we need to zero out the fsid
field unless it's root that's asking. This far, this has been done by
putting a struct statfs on the stack and modifying it.

struct statfs is large. Large things on the stack are bad. Create
copyout_statfs() that copies out a struct statfs to userland, does the
necessary root check and gives userland what it needs withtout wasting
stack space.

pedro@, deraadt@ ok.

orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars