[linux-lvm] lvcreate from a setuid-root binary

Alasdair G Kergon agk at redhat.com
Sat Nov 17 00:24:05 UTC 2018


On Fri, Nov 16, 2018 at 02:43:10PM +0100, Christoph Pleger wrote:
> I get security by checking the real user id at the beginning of the  
> program and aborting the program if that uid does not belong to the only  
> user who is allowed to run the program. 

Sounds familiar.  Shall I tell you one of those stories?

I used a system where the sysadmin was worried that letting people run
the setuid 'su' binary was too dangerous, so he wrote a wrapper around
it to "improve" security.  The wrapper checked you were in the admin
group before letting you run the real 'su'.  Of course anyone who
understood how setuid works better than he did could now use the
wrapper in numerous different ways to become root directly without a
password.  

If you care about security find another solution that doesn't involve
writing your own privileged code to be run under the control of an
unprivileged user.

Alasdair




More information about the linux-lvm mailing list