Skip to contentSkip to conversation

patched wdm (new API)

DISCUSSION Tom 5 participants 6 messages Oct 2, 2003 – Dec 1, 2003 SELinux security module

lore
Share & tools
lore

Tom

author
#0 lore raw

Hi everyone -

I have patched the current wdm version so we have again an SELinux-aware graphical login available.

Diff file and Debian package for Sid are on my website
(http://selinux.lemuria.org)

I have submitted the patch upstream for inclusion into the wdm tree.

I also would like to congratulate everyone who was involved in creating the new API. It was much, much easier to patch wdm this time around, and it required less total and especially less intrusive changes.

Tom

Signature · 8 lines
PGP/GPG key: http://web.lemuria.org/pubkey.html
pub  1024D/2D7A04F5 2002-05-16 Tom Vogt <[email protected]>
     Key fingerprint = C731 64D1 4BCF 4C20 48A4  29B2 BF01 9FA1 2D7A 04F5

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#1 lore raw
Quoted 2 lines · Tom

I have patched the current wdm version so we have again an SELinux-aware graphical login available.

Out of curiosity: wdm requires WindowMaker as well, right?

Is there any chance these patches could be applied to xdm as well?

Peter

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#2 lore raw
Quoted 6 lines · Peter Simons

 > I have patched the current wdm version so we have again an > SELinux-aware graphical login available.

Out of curiosity: wdm requires WindowMaker as well, right?

Is there any chance these patches could be applied to xdm as well?

Have you tried the PAM module that Dan wrote? It should work for xdm as long as it's PAM enabled.

Signature · 11 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
author
#4 lore raw
In reply to Peter Simons
Quoted 4 lines · Peter Simons
Quoted 2 lines

I have patched the current wdm version so we have again an SELinux-aware graphical login available.

Out of curiosity: wdm requires WindowMaker as well, right?

No, it does require some of wmaker's libraries, but not wmaker itself, and it will happily launch any other window manager, KDE or Gnome.

Quoted 1 line

Is there any chance these patches could be applied to xdm as well?

Absolutely. The patch is trivial enough and wdm was chosen by me explicitly because it is much simpler and much closer to xdm then the other (kdm, gdm) login managers.

Take a look at the patch - most of it is for configure and makefile stuff, the actual code change is about a dozen lines.

Signature · 8 lines
http://web.lemuria.org/pubkey.html
pub  1024D/2D7A04F5 2002-05-16 Tom Vogt <[email protected]>
     Key fingerprint = C731 64D1 4BCF 4C20 48A4  29B2 BF01 9FA1 2D7A 04F5

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#3 lore raw
In reply to Russell Coker
Quoted 2 lines · Russell Coker

Have you tried the PAM module that Dan wrote? It should work for xdm as long as it's PAM enabled.

I don't think you can just use a PAM session module for [xgk]dm; the pam_open_session call is performed from the wrong process. But there is a patched gdm available from Dan's site, under ftp://people.redhat.com/dwalsh/SELinux, that will obtain and use the user's default context.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#5 lore raw
In reply to Tom
Quoted 4 lines · Tom

Hi everyone - I have patched the current wdm version so we have again an SELinux-aware graphical login available.

I have submitted the patch upstream for inclusion into the wdm tree.

Quoted 3 lines · Stephen Smalley

there is a patched gdm available from Dan's site, under ftp://people.redhat.com/dwalsh/SELinux, that will obtain and use the user's default context.

Well, I have a nice xdm greeter setup, and I don't run
Gnome/KDE/Windowmaker, and I was disinclined to use startx just because I wanted to secure my laptop. So I went ahead and patched xdm from X 4.3.0 for SELinux. I have examined the patches for wdm/gdm, and this xdm patch provides the same capabilities as the other patches do.

This patch has been tested with and without SELinux support,
and on SELinux kernels, and vanilla kernels. This patch is against the CVS version of the Debian XFree86 code (significant, since the patches applied by Debian increase the fuzz (and may even require the patch to be manually applied on vanilla X 4.3.0).

I am working with Debian's XFree86 maintainer to get this
patch incorporated into Debian's X packages.

As implemented, the patch merely provides a capability, which
has to be explicitly turned on at compile time with -DHasSELinux=YES. If one does not compile with -DHasSELinux=YES, the patch is a no-op. Since none of the code is compiled in, there is no change in behaviour, nor is there any performance hit.

If you do turn on the SELinux compatibility with -DHasSELinux,
you would need libselinux at build time. In other words, the mainline X build does not build depend on SELinux; the dependency is only invoked if you explicitly pass a parameter to imake.

Even when SELinux compatibility is compiled in, on a non
SELinux kernel it is dead code; there is no change in functionality, apart from a single check to see if SELinux is available at each login. The SELinux code paths are not exercised on non-SELinux kernels.

The patch is fairly minimal (only 160 lines or so), and it
should be easy to check that is would not impact anything else.

manoj

xc/config/cf/Imake.tmpl +8 -4
diff -uBbwr xfree86-4.3.0-0.2003.11.30/xc/config/cf/Imake.tmpl xfree86-4.3.0-0.2003.11.30.sel/xc/config/cf/Imake.tmpl
@@ -2033,17 +2033,21 @@
  * EXTRA_INCLUDES contains project-specific includes set in project incfiles
  * INCLUDES contains client-specific includes set in Imakefile
  * LOCAL_LDFLAGS contains client-specific ld flags flags set in Imakefile
+ * SELINUX_INCLUDES contains SELinux-specific includes set in the appropriate .cf file
+ * SELINUX_LDFLAGS  contains SELinux-specific ld flags set in the appropriate .cf file
+ * SELINUX_CFLAGS  contains SELinux-specific compiler flags set in the .cf file
+ * SELINUX_LIBS   contains SELinux-specific libraries to link with set in the .cf file
  */
-      ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(INSTALLED_INCLUDES) $(STD_INCLUDES)
+      ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(INSTALLED_INCLUDES) $(STD_INCLUDES) $(SELINUX_INCLUDES)
        ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(THREADS_DEFINES) $(MODULE_DEFINES) $(DEFINES) $(EXTRA_DEFINES)
-           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(THREADS_CFLAGS) $(MODULE_CFLAGS) $(ALLDEFINES)
+           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(THREADS_CFLAGS) $(SELINUX_CFLAGS) $(MODULE_CFLAGS) $(ALLDEFINES)
         LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES) $(DEPEND_DEFINES)
          LDPRELIB = LdPreLib $(INSTALLED_LIBS)
         LDPOSTLIB = LdPostLib
-        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)  $(EXTRA_LDOPTIONS) $(THREADS_LDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIBS)
+        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)  $(EXTRA_LDOPTIONS) $(THREADS_LDFLAGS) $(SELINUX_LDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIBS)
      CXXLDOPTIONS = $(CXXDEBUGFLAGS) $(CXXOPTIONS) $(EXTRA_LDOPTIONS) $(THREADS_CXXLDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIBS)
 
-           LDLIBS = $(LDPOSTLIBS) $(THREADS_LIBS) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
+           LDLIBS = $(LDPOSTLIBS) $(THREADS_LIBS) $(SELINUX_LIBS) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
 #if HasBrokenCCForLink
            CCLINK = LdCmd
 #else
xc/config/cf/linux.cf +54 -0

57 lines not on this page · raw message

xc/programs/xdm/session.c +46 -0

64 lines not on this page · raw message

Signature · 5 lines
-- 
If you keep anything long enough, you can throw it away.
Manoj Srivastava   <[email protected]>    <[email protected]> 
1024R/C7261095 print CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C