From: ijackson@nyx.cs.du.edu (Ian Jackson)
Subject: Security hole in xdm in XFree86-1.2, 1.3
Date: 30 Aug 1993 20:44:21 GMT [thread overview]
Message-ID: <25tor5$q7l@samba.oit.unc.edu> (raw)
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 <ijackson@nyx.cs.du.edu> (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
reply other threads:[~1993-08-30 20:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox