LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-08-2013, 06:20 AM   #1
ulkoma
Member
 
Registered: Feb 2012
Distribution: CentOS
Posts: 69

Rep: Reputation: Disabled
Does not this conflict with the concept of DAC?


The fact that chown command requires root privileges? this means the original owner of a file can not transfer the ownership to somebody else? this sounds like MAC?

Sorry for being total noob
 
Old 05-08-2013, 09:04 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
it doesn't strictly need root, but it doesn't make sense to allow a user to make a file be opened by someone else of the same security level or higher.
 
Old 05-08-2013, 07:27 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
The issues with allowing users to give away files are that it provides a way to evade quotas, or to DoS another user by consuming his quota with a large file somewhere that he cannot delete it or even access it.
 
Old 05-08-2013, 08:10 PM   #4
Gullible Jones
Member
 
Registered: Apr 2011
Posts: 142

Rep: Reputation: 10
1. Copy a shell binary somewhere you have write access to
2. Make it setuid
3. Make it owned by root

Now you can run it and get a shell as root without ever knowing the root password!

This is why limited users cannot run chown. AFAIK this applies to all UNIX and Linux OSes.

Edit: of course you could probably restrict chown to prevent non-root users from setting root ownership, and restrict chmod to prevent non-root users from creating setuid/setgid files. Not sure why this isn't done, maybe it introduces too much complexity and failure-proneness?

(Restricting chmod in particular seems like a good idea to me, limited users should never need to create setuid, setgid, or sticky files/directories. But anyway you can get that effect by mounting all user-writable areas nosuid.)

Last edited by Gullible Jones; 05-08-2013 at 08:16 PM.
 
Old 05-09-2013, 12:27 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Gullible Jones View Post
1. Copy a shell binary somewhere you have write access to
2. Make it setuid
3. Make it owned by root

Now you can run it and get a shell as root without ever knowing the root password!

This is why limited users cannot run chown.
That's a nice description of why allowing it would be a Bad Thing but it's not the reason why. The actual explanation can be read from 'man capabilities' (CAP_CHOWN) and the description of 'man 2 chown'.
 
Old 05-12-2013, 09:19 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by Gullible Jones View Post
1. Copy a shell binary somewhere you have write access to
2. Make it setuid
3. Make it owned by root

Now you can run it and get a shell as root without ever knowing the root password!
Even in the early days of Unix when users were allowed to chown files, when a non-root user did so the setuid bit was cleared from the permissions. There is a similar protection in place for chgrp and the setgid bit.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a DAC work correctly in Slackware64 14.0 Cultist Slackware 2 12-06-2012 12:03 AM
Usb dac alienDog Linux - Hardware 3 11-17-2011 11:20 AM
Trouble with NUForce Amp (DAC) Seraphinianus Linux - Hardware 1 01-27-2010 05:33 AM
fubar USB II DAC location? tfrei Slackware 1 08-04-2008 03:00 PM
duplicating all sound in ALSA to an external DAC hedpe Linux - Hardware 2 10-09-2007 03:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration