Skip to contentSkip to conversation

another patch for the new release

PATCH Russell Coker 2 participants 5 messages Jul 12, 2003 – Jul 15, 2003 SELinux security module

lore
Share & tools
lore
#0 lore raw

I think that it is desirable that when a user is authorized for user_r and staff_r that staff_r is the default.

I patched spasswd to have svigr, and to fix a bug in the Makefile with creating a directory.

xstat_conv.h doesn't work for me, it seems that struct kern_stat not struct stat is required. Haven't fully tested this yet but at least it makes it compile.

A couple of minor changes to the devfsd shared object that I've posted here a couple of times but which don't seem to make it.

Also a patch to the makefile to make it compile on HPPA. Of course it doesn't really do much good without HPPA kernel support. ;)

Signature · 4 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
utils/appconfig/default_contexts +3 -3
@@ -1,3 +1,3 @@
-system_r:local_login_t  user_r:user_t staff_r:staff_t
-system_r:sshd_t		user_r:user_t staff_r:staff_t
-system_r:crond_t	user_r:user_crond_t staff_r:staff_crond_t system_r:system_crond_t
+system_r:local_login_t  staff_r:staff_t user_r:user_t
+system_r:sshd_t		staff_r:staff_t user_r:user_t
+system_r:crond_t	staff_r:staff_crond_t user_r:user_crond_t system_r:system_crond_t
utils/spasswd/Makefile +6 -2
@@ -14,12 +14,13 @@
 GROUPDEL=/usr/sbin/groupdel
 GROUPMOD=/usr/sbin/groupmod
 VIPW=/usr/sbin/vipw
+VIGR=/usr/sbin/vigr
 
 CFLAGS += -Wall -g -I$(INCDIR)
 LDFLAGS += -static -L$(LIBDIR)
 LIBS += -lsecure
 
-PROGS = spasswd sadminpasswd suseradd suserdel svipw schfn schsh sgpasswd susermod \
+PROGS = spasswd sadminpasswd suseradd suserdel svipw svigr schfn schsh sgpasswd susermod \
 	sgroupadd sgroupdel sgroupmod
 
 all:  $(PROGS)
@@ -42,6 +43,9 @@
 svipw.o: spasswd.c
 	$(CC) $(CFLAGS) -DADMIN_USE -DPASSWD=\"$(VIPW)\" -c -o $@ $<
 
+svigr.o: spasswd.c
+	$(CC) $(CFLAGS) -DADMIN_USE -DPASSWD=\"$(VIGR)\" -c -o $@ $<
+
 schfn.o: spasswd.c
 	$(CC) $(CFLAGS) -DPASSWD=\"$(CHFN)\" -c -o $@ $<
 
@@ -64,7 +68,7 @@
 	$(CC) $(CFLAGS) -DADMIN_USE  -DPASSWD=\"$(GROUPMOD)\" -c -o $@ $<
 
 install: all
-	test -d $(BINDIR) || install -m 755 -o root -g root $(BINDIR)
+	test -d $(BINDIR) || install -m 755 -d -o root -g root $(BINDIR)
 	install -m 555 -o root -g root $(PROGS) $(BINDIR)
 
 clean:
libsecure/src/xstat_conv.h +1 -1
@@ -36,7 +36,7 @@
 
     case _STAT_VER_LINUX:
       {
-	struct stat *buf = ubuf;
+	struct kernel_stat *buf = ubuf;
 
 	/* Convert to current kernel version of `struct stat'.  */
 	buf->st_dev = kbuf->st_dev;
devfsd/devfsd-conflet +3 -19
@@ -1,23 +1,7 @@
-REGISTER ^(kmem|mem|port)	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:memory_device_t
-REGISTER ^u?random	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:random_device_t
-REGISTER ^tty		CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:devtty_t
-REGISTER /disc$		CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:fixed_disk_device_t
-REGISTER /part[0-9]+$	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:fixed_disk_device_t
-REGISTER ^[mr]d/[0-9]+$	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:fixed_disk_device_t
+REGISTER ^nb[^/]+$	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:fixed_disk_device_t
 REGISTER [0-9]/cd$	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:removable_device_t
-REGISTER ^floppy/	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:removable_device_t
-REGISTER ^misc/rtc	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:clock_device_t
 REGISTER ^initctl	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:initctl_t
-REGISTER ^printers/	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:printer_t
-REGISTER ^input/(mouse|mice|event)	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:mouse_device_t
-REGISTER ^misc/psaux	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:mouse_device_t
 REGISTER ^gpmctl	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:gpmctl_t
-REGISTER ^ptmx		CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:ptmx_t
-REGISTER ^sound/	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:sound_device_t
-REGISTER ^agpgart	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:agp_device_t
 REGISTER ^dri		CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:dri_device_t
-REGISTER ^misc/apm_bios	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:apm_bios_t
-REGISTER ^ppp$		CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:ppp_device_t
-REGISTER ^fb/.*$	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:framebuf_device_t
-
-
+REGISTER ^sound/.*	CFUNCTION devfsd-se.so set_sid $devname system_u:object_r:sound_device_t
+REGISTER ^pts/.*	IGNORE
devfsd/devfsd-se.c +1 -1
@@ -19,7 +19,7 @@
 {
   security_id_t sid;
   struct stat buf;
-  const char * const initial_context = "system_u:object_r:devfs_t";
+  const char * const initial_context = "system_u:object_r:device_t";
   const char * const no_context = "system_u:object_r:unlabeled_t";
 
   if(is_flask_enabled())
module/Makefile +1 -1
@@ -6,7 +6,7 @@
 FLASKDIR=$(PREFIX)/flask
 INCDIR=$(PREFIX)/include
 
-ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
+ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/parisc.*/hppa/)
 
 # Build the checkpolicy program.
 all:
#1 lore raw
Quoted 2 lines · Russell Coker

I think that it is desirable that when a user is authorized for user_r and staff_r that staff_r is the default.

It doesn't really work to authorize a user for user_r and staff_r; expected role declarations would be either user_r for ordinary users (using user_home_*_t on the home directory) or { staff_r sysadm_r } for admins (using staff_home_*_t on the home directory). An admin won't be able to access his home directory if logged in as user_r, and will be vulnerable to attack by ordinary users.

Quoted 3 lines

xstat_conv.h doesn't work for me, it seems that struct kern_stat not struct stat is required. Haven't fully tested this yet but at least it makes it compile.

I don't think that this is what you want. If you are using older glibc with the old stat definitions, try using the older libsecure, i.e. the one prior to this release. In any event, this will be obsoleted by the new API.

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.
#2 lore raw
Quoted 5 lines · Stephen Smalley
Quoted 2 lines · Russell Coker

I think that it is desirable that when a user is authorized for user_r and staff_r that staff_r is the default.

It doesn't really work to authorize a user for user_r and staff_r;

So does this mean that we don't support the idea of changing to a less priviledged role to run untrusted programs?

I guess that using a different Unix account for such things will work, as anyone who is in staff_r can surely have their request for an extra account granted.

Quoted 8 lines
Quoted 3 lines

xstat_conv.h doesn't work for me, it seems that struct kern_stat not struct stat is required. Haven't fully tested this yet but at least it makes it compile.

I don't think that this is what you want. If you are using older glibc with the old stat definitions, try using the older libsecure, i.e. the one prior to this release. In any event, this will be obsoleted by the new API.

I'm using glibc 2.3.1, is it required to use 2.3.2 to get this to compile correctly?

Signature · 10 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.
#3 lore raw
Quoted 2 lines · Russell Coker

So does this mean that we don't support the idea of changing to a less priviledged role to run untrusted programs?

You can limit the initial login domain (user_t, staff_t, sysadm_t) to a minimal set of permissions, push many permissions into specific program domains, and transition to an even less privileged domain for untrusted programs. Not clear that staff_t should include any special permissions other than the ability to transition to sysadm_t, although it presently has a few privileges. You wouldn't have staff_t transition to user_t for running untrusted programs; have it transition to its own derived domain for that purpose.

Quoted 2 lines

I'm using glibc 2.3.1, is it required to use 2.3.2 to get this to compile correctly?

Yes, I think so. Reverse the libsecure patch that was posted to the
list a while back if using glibc 2.3.1.

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.
#4 lore raw
In reply to Russell Coker
Quoted 10 lines · Russell Coker

I think that it is desirable that when a user is authorized for user_r and staff_r that staff_r is the default.

I patched spasswd to have svigr, and to fix a bug in the Makefile with creating a directory.

xstat_conv.h doesn't work for me, it seems that struct kern_stat not struct stat is required. Haven't fully tested this yet but at least it makes it compile.

Quoted 5 lines

A couple of minor changes to the devfsd shared object that I've posted here a couple of times but which don't seem to make it.

Also a patch to the makefile to make it compile on HPPA. Of course it doesn't really do much good without HPPA kernel support. ;)

A subset of these diffs have been committed to the sourceforge CVS tree, omitting the default_contexts diff and the xstat_conv.h diff.

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.