Bug 58843

Summary: chown does not strip suid bit
Product: [Retired] Red Hat Linux Reporter: Need Real Name <vader>
Component: kernelAssignee: Arjan van de Ven <arjanv>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: alan
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-02-11 16:29:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2002-01-25 18:30:41 UTC
Description of Problem:
chowning an suid file does not strip the suid bit.

IMHO this is an important safety feature.  I'm not sure at which version the 2.4
kernel series began doing this, but in 2.2 it was added into 2.2.13:
http://www.linux.org.uk/VERSION/relnotes.2213.html
(search for string "chown").

Steps to Reproduce:
1. chown nobody /bin/su
2. ls -l /bin/su


Actual Results:
-rws--x---    1 nobody     wheel       18452 Jul 23  2001 /bin/su

Expected Results:
-rwx--x---    1 nobody     wheel       18452 Jul 23  2001 /bin/su

Additional Information:
Reproducible at least on kernel-2.4.9-21

Comment 1 Alan Cox 2002-02-11 16:34:34 UTC
POSIX does not require this, furthermore there are other reasons it is a bad
idea such as mandatory locking flags. See the man page for a detailed discussion
on this.