4 ms·
This is also similar to how root used to work on Android devices. Since SElinux policies were enforced preventing the su binary from becoming root through setui
by supriyo-biswas 3y ago
This is also similar to how root used to work on Android devices. Since SElinux policies were enforced preventing the su binary from becoming root through setuid/setgid, a daemon used to start up at boot, and the su command was simply a proxy that connected to the daemon whenever called by an app.
However I wouldn’t call for the deprecation of setuid entirely: ping and traceroute still use them to set up raw sockets to send out IP data grams with custom values.
- charcircuit 3y agoThere could be a ping / traceroute service the ping and trace route commands connect to. For security the user the service runs under should not have full root, but only CAP_NET_RAW. systemd even lets you make services that start up when recieving a message over dbus so you can avoid always having the service always running.
- globular-toast 3y agoYou can allow raw sockets using capabilities.
- dgl 3y agoPing and traceroute really shouldn’t need setuid on Linux anymore. tracepath uses an option to set the TTL and works without setuid (although options like TCP tracerouting aren’t possible with that, but as mentioned that can use CAP_NET_RAW). ping can also use a similar API to run fine unprivileged (fairly sure Fedora uses that already to have a non-setuid ping).