Bug 56479 - sys-kernel/*: fchown may allow unrestricted file groupIDs modifications
Bug#: 56479 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: All Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: security@gentoo.org Reported By: koon@gentoo.org
Component: Security
URL:  http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0497
Summary: sys-kernel/*: fchown may allow unrestricted file groupIDs modifications
Keywords:  
Status Whiteboard: A3 [kernel+]
Opened: 2004-07-08 12:56 0000
Description:   Opened: 2004-07-08 12:56 0000
From http://xforce.iss.net/xforce/xfdb/16599 :

Linux kernel versions 2.4 and 2.6 could allow a local attacker to mount a remote file system from a vulnerable system and modify files' group IDs, caused by a missing check in the fchown function.

Note: Linux kernel version 2.4 kernel is affected by this vulnerability if the file system is shared via an NFS server.

CAN-2004-0497

------- Comment #1 From Chris White (RETIRED) 2004-07-08 17:11:53 0000 -------
Got the patches from upstream.. posting them now.

btw, the issue was in attr code, not really in fchown code.

------- Comment #2 From Chris White (RETIRED) 2004-07-08 17:12:33 0000 -------
Created an attachment (id=35037) [details]
Patch for 2.6 attr exploit

------- Comment #3 From Chris White (RETIRED) 2004-07-08 17:13:26 0000 -------
Created an attachment (id=35038) [details]
2.6 kernel /proc filesystem missing attr check patch

------- Comment #4 From Chris White (RETIRED) 2004-07-08 17:14:12 0000 -------
Created an attachment (id=35039) [details]
2.4 kernel sys_chown exploit patch

------- Comment #5 From Chris White (RETIRED) 2004-07-08 17:14:55 0000 -------
Created an attachment (id=35040) [details]
2.4 kernel missing ) in inode_change code patch

------- Comment #6 From Brandon Hale (RETIRED) 2004-07-08 18:31:19 0000 -------
Both of these fixes have been in {gentoo,hardened}-dev-sources for a bit now.
I dont recall if there was an earlier Gentoo bug, but the SuSE/RH advisories have been around for a bit.

------- Comment #7 From Brandon Hale (RETIRED) 2004-07-08 18:37:30 0000 -------
Con added the fixes to -ck5 upstream, so a version bump will close the vuln
there as well. (Bump requested in #56337)

------- Comment #8 From Thierry Carrez (RETIRED) 2004-07-09 01:19:13 0000 -------
Maybe this is already fixed in most of our sources, I opened this one to check
that all sources are OK with this problem, as it was not listed in the recent
kernel GLSA.

------- Comment #9 From Tim Yamin (RETIRED) 2004-07-09 06:20:41 0000 -------
(From update of attachment 35039 [details])
Marking patch as obsolete since the 2.6 one does not have parenthesis issues
and applies fine on 2.4.

------- Comment #10 From Tim Yamin (RETIRED) 2004-07-09 06:20:58 0000 -------
(From update of attachment 35040 [details])
Marking patch as obsolete since the 2.6 one does not have parenthesis issues
and applies fine on 2.4.

------- Comment #11 From Tim Yamin (RETIRED) 2004-07-09 11:23:23 0000 -------
OK, everything should now be patched. The following sources remain, and I'm
adding their maintainers to the CC list:

grsec-sources: Adding solar.
hardened-sources: Adding hardened herd and scox.
hppa-(dev-)sources: Adding GMSoft.
mips-sources: Adding `Kumba.
openmosix-sources: Adding the cluster herd.
pegasos-(dev-)sources: Adding dholm.
rsbac-(dev-)sources: Adding kang.
selinux-sources: Adding pebenito.

------- Comment #12 From Guy Martin 2004-07-09 12:40:42 0000 -------
All done for hppa.

------- Comment #13 From Konstantin Arkhipov 2004-07-10 05:36:54 0000 -------
all done for openMosix-sources.

------- Comment #14 From Donnie Berkholz 2004-07-10 13:40:22 0000 -------
In that case..

------- Comment #15 From Tim Yamin (RETIRED) 2004-07-11 05:47:44 0000 -------
Seems to be done for grsec-sources as well...

------- Comment #16 From solar 2004-07-11 06:24:57 0000 -------
yeah twice.

updated revision to grsec-sources-2.4.26.2.0-r6 and added the openmosix-sources.CAN-2004-0497.patch

------- Comment #17 From Joshua Brindle (RETIRED) 2004-07-11 14:29:18 0000 -------
selinux-sources patched

------- Comment #18 From Thierry Carrez (RETIRED) 2004-07-16 06:12:41 0000 -------
Still waiting for the following sources to be patched for CAN-2004-0497:
- hardened-sources
- mips-sources [reAdding `Kumba]
- pegasos-(dev-)sources
- rsbac-(dev-)sources

------- Comment #19 From Guillaume Destuynder (RETIRED) 2004-07-16 10:23:04 0000 -------
rsbac-(dev-)sources: patched

------- Comment #20 From Joshua Kinard 2004-07-17 13:27:01 0000 -------
This was one of those patches I saw in an updated SuSE kernel, but I couldn't
find a description or patch for -0497.  Is there a description and/or patch for
-0496 as well (also fixed in the updated SuSE kernel)?

------- Comment #21 From Thierry Carrez (RETIRED) 2004-07-20 08:22:54 0000 -------
The only reference I can find on -0496 is the SuSE advisory. No description, no
patch. According to CVE description, it is a superset of the Sparse-found
vulnerabilities we already fixed (-0495).

Still waiting for :
- hardened-sources
- mips-sources
- pegasos-(dev-)sources

------- Comment #22 From David Holm (RETIRED) 2004-07-21 02:38:26 0000 -------
pegasos(-dev)-sources fixed

------- Comment #23 From Andrea Luzzardi 2004-07-21 06:02:02 0000 -------
Heya, as I said in my ~/.away (http://dev.gentoo.org/devaway/), I don't have
any connection at home at the moment (so no access to CVS).

I could however bring my ssh keys at work tomorrow, if noone else from the
hardened herd can add the patch for me.

------- Comment #24 From Tim Yamin (RETIRED) 2004-07-22 05:09:16 0000 -------
GLSA 200407-16.

------- Comment #25 From Joshua Kinard 2004-07-22 19:19:20 0000 -------
mips-sources fixed

------- Comment #26 From Thierry Carrez (RETIRED) 2004-07-23 00:48:44 0000 -------
GLSA should be updated to reflect the mips-sources fix. 

Additionally, development-sources-2.6.8_rc1 should be marked stable on x86, ppc, arm as it is the fixed version...

------- Comment #27 From Tim Yamin (RETIRED) 2004-07-23 03:57:36 0000 -------
Readding `Kumba - the 2.6 kernels also need the /proc patch attached to this
bug; and 2.4 needs patching for CAN-2004-0497, but not the /proc issue.

------- Comment #28 From Andrea Luzzardi 2004-07-23 07:36:50 0000 -------
hardened-sources fixed yesterday, before the GLSA went out.

------- Comment #29 From Joshua Kinard 2004-08-01 23:59:26 0000 -------
Mips fixed (I hope I'm not missing anything else)