From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f6cac,4d06cf17b5bdb628,start X-Google-Attributes: gidf6cac,public X-Google-Thread: 10d4db,4d06cf17b5bdb628,start X-Google-Attributes: gid10d4db,public X-Google-ArrivalTime: 1993-08-30 14:03:52 PST Xref: gmd.de comp.os.linux.announce:1091 comp.windows.x.i386unix:3574 Path: gmd.de!newsserver.jvnc.net!udel!gatech!concert!samba.oit.unc.edu!bounce-bounce From: ijackson@nyx.cs.du.edu (Ian Jackson) Newsgroups: comp.os.linux.announce,comp.windows.x.i386unix Subject: Security hole in xdm in XFree86-1.2, 1.3 Followup-To: comp.windows.x.i386unix Date: 30 Aug 1993 20:44:21 GMT Organization: Linux Unlimited Message-ID: <25tor5$q7l@samba.oit.unc.edu> Reply-To: ijackson@nyx.cs.du.edu (Ian Jackson) NNTP-Posting-Host: calypso.oit.unc.edu Keywords: xdm, xfree86, security, groups Originator: mdw@sunSITE I have found that xdm from XFree86-1.2 and 1.3 fails to set the list of groups correctly under Linux, due to #define'ing GID_T to be int, rather than gid_t (==short). This means that only the groups in the first half of the intended list are actually set, interleaved with multiple instances of the zero group. On many systems group 0 is the `system' group, and is able to write to critical files and/or directories. I enclose a patch to dm.h in the xdm sources which adds __linux__ to the list of systems in the #ifdef for using gid_t. IMHO the correct answer is to rip out all the horrible group-searching logic and have xdm call the library function available for exactly this purpose: initgroups. However I didn't feel I had sufficient understanding of xdm's rather tortuous internals to do this right. The source I have came from the BSD X distribution, but the Linux binaries I have from XFree86-1.2 and 1.3 both exhibit the same buggy behaviour. I don't know whether earlier releases of XFree86/X386 have the problem. By the time you read this I will have uploaded a fixed binary to sunsite and tsx-11. My PGP2 digital signature of the gzipped binary is enclosed below. Note that it has had another alteration made to make it display the kernel version between the hostname (err, whatever your normal greeting string is) and login prompt. If you don't like it get the source and compile your own :-). It would be nice if XFree86-2.0 had an xdm that had this bug fixed. diff -u dm.h{~,} --- dm.h~ Fri Sep 25 04:39:54 1992 +++ dm.h Mon Aug 30 12:41:27 1993 @@ -239,7 +239,7 @@ }; /* setgroups is not covered by POSIX, arg type varies */ -#if defined(SYSV) || defined(SVR4) +#if defined(SYSV) || defined(SVR4) || defined(__linux__) #define GID_T gid_t #else #define GID_T int -----BEGIN PGP MESSAGE----- Version: 2.3a iQCVAgUALIHr7cMWjroj9a3bAQHrUAP/fbgA9VNRg5buVGK9wAdDxtf485kxlowq PCsntNwQy+1nbEMtZ3yqKTKnWIkD1hiP0Pl9IN48idb2VGdRN9ky+9cduz11w3e8 aLmKa4Ut5GZ+CKvyXCquOAvM7Z5eCUtAWJGblw8rT2NNZIJLhPqD8NZl7NXYHMQk WqWFJxropuI= =Owzx -----END PGP MESSAGE----- -- Ian Jackson (urgent email: iwj10@phx.cam.ac.uk) 35 Molewood Close, Cambridge, CB4 3SR, England; phone: +44 223 327029 PGP2 public key on request; fingerprint = 5906F687 BD03ACAD 0D8E602E FCF37657 -- Send submissions for comp.os.linux.announce to: linux-announce@tc.cornell.edu