Page MenuHomeFreeBSD

netstat: strip the binary of sgid
AcceptedPublic

Authored by kevans on Mon, Oct 21, 4:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 28, 7:42 PM
Unknown Object (File)
Mon, Oct 28, 4:22 AM
Unknown Object (File)
Sat, Oct 26, 9:07 PM
Unknown Object (File)
Sat, Oct 26, 11:09 AM
Unknown Object (File)
Sat, Oct 26, 11:09 AM
Unknown Object (File)
Sat, Oct 26, 11:08 AM
Unknown Object (File)
Sat, Oct 26, 10:48 AM
Unknown Object (File)
Sat, Oct 26, 5:00 AM
Subscribers

Details

Reviewers
glebius
Group Reviewers
network
Summary

Everything in the live path seems to use sysctls these days, with kvm
only being used for pulling information from core dumps. Strip the
binary of /dev/{k,}mem access to reduce the surface area with access
to kmem.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 60143
Build 57027: arc lint + arc unit

Event Timeline

There are some calls setgid(getgid()) in netstat which aim to drop privileges. I guess those should be removed too?

Drop setgid(2) calls meant to drop privileges, now that we don't have privs

There are some calls setgid(getgid()) in netstat which aim to drop privileges. I guess those should be removed too?

I also found one other call to kresolve_list() that I thought could go away, but it turns out that we actually still need /dev/mem for netstat -rs. Shelving this for the time being, but reimplementing rt_stats() for the live case doesn't seem like it'd be too difficult.

This revision is now accepted and ready to land.Tue, Oct 22, 5:06 PM