Bug 58843 - chown does not strip suid bit
chown does not strip suid bit
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Arjan van de Ven
Brian Brock
: Security
Depends On:
  Show dependency treegraph
Reported: 2002-01-25 13:30 EST by Need Real Name
Modified: 2007-04-18 12:39 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-02-11 11:29:57 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2002-01-25 13:30:41 EST
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:
(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 11:34:34 EST
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.

Note You need to log in before you can comment on or make changes to this bug.