Skip to contentSkip to conversation

: patch to allow plymouthd use unallocated ttys

PATCH New Guido Trentalancia 2 participants 7 messages Feb 16, 2011 – Mar 7, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 17/34 : patch to allow plymouthd use unallocated ttys

This patch allows plymouthd to use unallocated ttys.

policy/modules/services/plymouthd.te +2 -0
diff -pruN -x booleans.conf -x corenetwork.if -x corenetwork.te -x modules.conf refpolicy-git-02022011/policy/modules/services/plymouthd.te refpolicy-git-02022011-new/policy/modules/services/plymouthd.te
@@ -64,6 +64,8 @@ miscfiles_read_localization(plymouthd_t)
 miscfiles_read_fonts(plymouthd_t)
 miscfiles_manage_fonts_cache(plymouthd_t)
 
+term_use_unallocated_ttys(plymouthd_t)
+
 ########################################
 #
 # Plymouth private policy
#1 lore raw

PATCH 17/34 : patch to allow plymouthd use unallocated ttys

Quoted 6 lines · Guido Trentalancia

This patch allows plymouthd to use unallocated ttys.

diff -pruN -x booleans.conf -x corenetwork.if -x corenetwork.te -x modules.conf refpolicy-git-02022011/policy/modules/services/plymouthd.te refpolicy-git-02022011-new/policy/modules/services/plymouthd.te

policy/modules/services/plymouthd.te miscfiles_read_localization(plymouthd_t) · line 71

Quoted 8 lines
policy/modules/services/plymouthd.te +2 -0
@@ -64,6 +64,8 @@ miscfiles_read_localization(plymouthd_t)
 miscfiles_read_fonts(plymouthd_t)
 miscfiles_manage_fonts_cache(plymouthd_t)
 
+term_use_unallocated_ttys(plymouthd_t)
+
 ########################################
 #
 # Plymouth private policy

Why? Would it be possible to specifically label the devices?

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#2 lore raw

PATCH 17/34 : patch to allow plymouthd use unallocated ttys

Hello Christopher !

Quoted 10 lines · Christopher J. PeBenito
Quoted 9 lines · Guido Trentalancia

This patch allows plymouthd to use unallocated ttys.

diff -pruN -x booleans.conf -x corenetwork.if -x corenetwork.te -x modules.conf refpolicy-git-02022011/policy/modules/services/plymouthd.te refpolicy-git-02022011-new/policy/modules/services/plymouthd.te

policy/modules/services/plymouthd.te +0 -0
@@ -64,6 +64,8 @@ miscfiles_read_localization(plymouthd_t)
 miscfiles_read_fonts(plymouthd_t)
 miscfiles_manage_fonts_cache(plymouthd_t)
 
Quoted 7 lines

policy/modules/services/plymouthd.te miscfiles_read_localization(plymouthd_t) · line 71

Quoted 5 lines
policy/modules/services/plymouthd.te +2 -0
+term_use_unallocated_ttys(plymouthd_t)
+
 ########################################
 #
 # Plymouth private policy

Why? Would it be possible to specifically label the devices?

I think they are unallocated not unlabelled.

They have label tty_device_t and what is needed is chr_file { write ioctl read open getattr append }.

Possibly it's stuff such as /dev/tty63, /dev/hvc0 and so on.

By the way, recently I had to add these (to use ftp as root from a console):

kernel_request_load_module(sysadm_t) in policy/modules/roles/sysadm.te (trying to load ipv6 module) corenet_tcp_bind_generic_node(sysadm_t) in policy/modules/roles/sysadm.te (ftp list directory)

And there might be more, I am still testing...

What am I getting wrong here ? Apparently the console is having some issues (and perhaps not just with ftp) that are not showing up from an X terminal... So either I am doing something wrong or what's the reason for having a console much more restricted than X terminals ??

Regards,

Guido

#3 lore raw

PATCH 17/34 : patch to allow plymouthd use unallocated ttys

Quoted 21 lines · Guido Trentalancia

Hello Christopher !

Quoted 10 lines · Christopher J. PeBenito
Quoted 9 lines · Guido Trentalancia

This patch allows plymouthd to use unallocated ttys.

diff -pruN -x booleans.conf -x corenetwork.if -x corenetwork.te -x modules.conf refpolicy-git-02022011/policy/modules/services/plymouthd.te refpolicy-git-02022011-new/policy/modules/services/plymouthd.te

policy/modules/services/plymouthd.te +0 -0
@@ -64,6 +64,8 @@ miscfiles_read_localization(plymouthd_t)
 miscfiles_read_fonts(plymouthd_t)
 miscfiles_manage_fonts_cache(plymouthd_t)
 
Quoted 7 lines

policy/modules/services/plymouthd.te miscfiles_read_localization(plymouthd_t) · line 71

Quoted 5 lines
policy/modules/services/plymouthd.te +2 -0
+term_use_unallocated_ttys(plymouthd_t)
+
 ########################################
 #
 # Plymouth private policy

Why? Would it be possible to specifically label the devices?

Quoted 6 lines

I think they are unallocated not unlabelled.

They have label tty_device_t and what is needed is chr_file { write ioctl read open getattr append }.

Possibly it's stuff such as /dev/tty63, /dev/hvc0 and so on.

The point is that we want to isolate the access if possible. If it only works on /dev/tty63, then we can consider giving that a different label.

Quoted 5 lines

By the way, recently I had to add these (to use ftp as root from a console):

kernel_request_load_module(sysadm_t) in policy/modules/roles/sysadm.te (trying to load ipv6 module)

Not a problem to add this, since sysadm can actively insert modules.

Quoted 2 lines

corenet_tcp_bind_generic_node(sysadm_t) in policy/modules/roles/sysadm.te (ftp list directory)

My guess is this has to do with active mode FTP.

Quoted 6 lines

And there might be more, I am still testing...

What am I getting wrong here ? Apparently the console is having some issues (and perhaps not just with ftp) that are not showing up from an X terminal... So either I am doing something wrong or what's the reason for having a console much more restricted than X terminals ??

They shouldn't be. Perhaps the ipv6 module is loaded by the time you get X started. As for the FTP, are you doing it as sysadm_t in X too?

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#4 lore raw

PATCH 17/34 : patch to allow plymouthd use unallocated ttys

Quoted 24 lines · Christopher J. PeBenito
Quoted 23 lines · Guido Trentalancia

Hello Christopher !

Quoted 10 lines · Christopher J. PeBenito
Quoted 9 lines · Guido Trentalancia

This patch allows plymouthd to use unallocated ttys.

diff -pruN -x booleans.conf -x corenetwork.if -x corenetwork.te -x modules.conf refpolicy-git-02022011/policy/modules/services/plymouthd.te refpolicy-git-02022011-new/policy/modules/services/plymouthd.te

policy/modules/services/plymouthd.te +0 -0
@@ -64,6 +64,8 @@ miscfiles_read_localization(plymouthd_t)
 miscfiles_read_fonts(plymouthd_t)
 miscfiles_manage_fonts_cache(plymouthd_t)
 
Quoted 7 lines

policy/modules/services/plymouthd.te miscfiles_read_localization(plymouthd_t) · line 71

Quoted 5 lines
policy/modules/services/plymouthd.te +2 -0
+term_use_unallocated_ttys(plymouthd_t)
+
 ########################################
 #
 # Plymouth private policy

Why? Would it be possible to specifically label the devices?

I think they are unallocated not unlabelled.

Quoted 7 lines
Quoted 4 lines

They have label tty_device_t and what is needed is chr_file { write ioctl read open getattr append }.

Possibly it's stuff such as /dev/tty63, /dev/hvc0 and so on.

The point is that we want to isolate the access if possible. If it only works on /dev/tty63, then we can consider giving that a different label.

It is defined at compile time. Basically there are two devices:

BOOT_TTY "/dev/tty1"
SHUTDOWN_TTY "/dev/tty63"

but the above are just the default values and they can be changed using configure options.

Of course isolating an access is always good, but consider the above and consider that this package is only used by Fedora... More or less it's a just toy.

I am not sure that relabeling generic devices such as tty1 and tty63 is a good idea.

Quoted 15 lines
Quoted 5 lines

By the way, recently I had to add these (to use ftp as root from a console):

kernel_request_load_module(sysadm_t) in policy/modules/roles/sysadm.te (trying to load ipv6 module)

Not a problem to add this, since sysadm can actively insert modules.

Quoted 2 lines

corenet_tcp_bind_generic_node(sysadm_t) in policy/modules/roles/sysadm.te (ftp list directory)

My guess is this has to do with active mode FTP.

Quoted 2 lines

And there might be more, I am still testing...

Quoted 7 lines
Quoted 4 lines

What am I getting wrong here ? Apparently the console is having some issues (and perhaps not just with ftp) that are not showing up from an X terminal... So either I am doing something wrong or what's the reason for having a console much more restricted than X terminals ??

They shouldn't be. Perhaps the ipv6 module is loaded by the time you get X started. As for the FTP, are you doing it as sysadm_t in X too?

Yes, it is probably related to the active mode. But it should be allowed as sysadm_t. We need to check the console functionality carefully as soon as all the other pending patches have been sorted out.

The ipv6 module is disabled. Of course this does not prevent new requests from being made (applications do not know it's disabled)...

As for the ftp client, I am doing it from xdm_t under X (from a "graphical" terminal). It's just one of many other things that are not fully functional under the console. We'll get into all that pain soon...

Regards,

Guido

#5 lore raw

PATCH 17/34 : patch to allow plymouthd use unallocated ttys

Quoted 41 lines · Guido Trentalancia
Quoted 24 lines · Christopher J. PeBenito
Quoted 23 lines · Guido Trentalancia

Hello Christopher !

Quoted 10 lines · Christopher J. PeBenito
Quoted 9 lines · Guido Trentalancia

This patch allows plymouthd to use unallocated ttys.

diff -pruN -x booleans.conf -x corenetwork.if -x corenetwork.te -x modules.conf refpolicy-git-02022011/policy/modules/services/plymouthd.te refpolicy-git-02022011-new/policy/modules/services/plymouthd.te

policy/modules/services/plymouthd.te +0 -0
@@ -64,6 +64,8 @@ miscfiles_read_localization(plymouthd_t)
 miscfiles_read_fonts(plymouthd_t)
 miscfiles_manage_fonts_cache(plymouthd_t)
 
Quoted 7 lines

policy/modules/services/plymouthd.te miscfiles_read_localization(plymouthd_t) · line 71

Quoted 5 lines
policy/modules/services/plymouthd.te +2 -0
+term_use_unallocated_ttys(plymouthd_t)
+
 ########################################
 #
 # Plymouth private policy

Why? Would it be possible to specifically label the devices?

I think they are unallocated not unlabelled.

Quoted 7 lines
Quoted 4 lines

They have label tty_device_t and what is needed is chr_file { write ioctl read open getattr append }.

Possibly it's stuff such as /dev/tty63, /dev/hvc0 and so on.

The point is that we want to isolate the access if possible. If it only works on /dev/tty63, then we can consider giving that a different label.

It is defined at compile time. Basically there are two devices:

BOOT_TTY "/dev/tty1"
SHUTDOWN_TTY "/dev/tty63"

but the above are just the default values and they can be changed using configure options.

Quoted 6 lines

Of course isolating an access is always good, but consider the above and consider that this package is only used by Fedora... More or less it's a just toy.

I am not sure that relabeling generic devices such as tty1 and tty63 is a good idea.

Since the default is tty1, I'd have to agree. Though I think its unfortunate.

Quoted 27 lines
Quoted 15 lines
Quoted 5 lines

By the way, recently I had to add these (to use ftp as root from a console):

kernel_request_load_module(sysadm_t) in policy/modules/roles/sysadm.te (trying to load ipv6 module)

Not a problem to add this, since sysadm can actively insert modules.

Quoted 2 lines

corenet_tcp_bind_generic_node(sysadm_t) in policy/modules/roles/sysadm.te (ftp list directory)

My guess is this has to do with active mode FTP.

Quoted 2 lines

And there might be more, I am still testing...

Quoted 7 lines
Quoted 4 lines

What am I getting wrong here ? Apparently the console is having some issues (and perhaps not just with ftp) that are not showing up from an X terminal... So either I am doing something wrong or what's the reason for having a console much more restricted than X terminals ??

They shouldn't be. Perhaps the ipv6 module is loaded by the time you get X started. As for the FTP, are you doing it as sysadm_t in X too?

Yes, it is probably related to the active mode. But it should be allowed as sysadm_t. We need to check the console functionality carefully as soon as all the other pending patches have been sorted out.

Quoted 6 lines

The ipv6 module is disabled. Of course this does not prevent new requests from being made (applications do not know it's disabled)...

As for the ftp client, I am doing it from xdm_t under X (from a "graphical" terminal). It's just one of many other things that are not fully functional under the console. We'll get into all that pain soon...

If you're running as a user as xdm_t, it is the wrong domain. If that is why there is a bunch of added xdm_t dbus access in your patches, those rules shouldn't be added.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#6 lore raw

PATCH 17/34 : patch to allow plymouthd use unallocated ttys

Quoted 82 lines · Christopher J. PeBenito
Quoted 41 lines · Guido Trentalancia
Quoted 24 lines · Christopher J. PeBenito
Quoted 23 lines · Guido Trentalancia

Hello Christopher !

Quoted 10 lines · Christopher J. PeBenito
Quoted 9 lines · Guido Trentalancia

This patch allows plymouthd to use unallocated ttys.

diff -pruN -x booleans.conf -x corenetwork.if -x corenetwork.te -x modules.conf refpolicy-git-02022011/policy/modules/services/plymouthd.te refpolicy-git-02022011-new/policy/modules/services/plymouthd.te

policy/modules/services/plymouthd.te +0 -0
@@ -64,6 +64,8 @@ miscfiles_read_localization(plymouthd_t)
 miscfiles_read_fonts(plymouthd_t)
 miscfiles_manage_fonts_cache(plymouthd_t)
 
Quoted 7 lines

policy/modules/services/plymouthd.te miscfiles_read_localization(plymouthd_t) · line 71

Quoted 5 lines
policy/modules/services/plymouthd.te +2 -0
+term_use_unallocated_ttys(plymouthd_t)
+
 ########################################
 #
 # Plymouth private policy

Why? Would it be possible to specifically label the devices?

I think they are unallocated not unlabelled.

Quoted 7 lines
Quoted 4 lines

They have label tty_device_t and what is needed is chr_file { write ioctl read open getattr append }.

Possibly it's stuff such as /dev/tty63, /dev/hvc0 and so on.

The point is that we want to isolate the access if possible. If it only works on /dev/tty63, then we can consider giving that a different label.

It is defined at compile time. Basically there are two devices:

BOOT_TTY "/dev/tty1"
SHUTDOWN_TTY "/dev/tty63"

but the above are just the default values and they can be changed using configure options.

Quoted 6 lines

Of course isolating an access is always good, but consider the above and consider that this package is only used by Fedora... More or less it's a just toy.

I am not sure that relabeling generic devices such as tty1 and tty63 is a good idea.

Since the default is tty1, I'd have to agree. Though I think its unfortunate.

Quoted 30 lines
Quoted 15 lines
Quoted 5 lines

By the way, recently I had to add these (to use ftp as root from a console):

kernel_request_load_module(sysadm_t) in policy/modules/roles/sysadm.te (trying to load ipv6 module)

Not a problem to add this, since sysadm can actively insert modules.

Quoted 2 lines

corenet_tcp_bind_generic_node(sysadm_t) in policy/modules/roles/sysadm.te (ftp list directory)

My guess is this has to do with active mode FTP.

Quoted 2 lines

And there might be more, I am still testing...

Quoted 7 lines
Quoted 4 lines

What am I getting wrong here ? Apparently the console is having some issues (and perhaps not just with ftp) that are not showing up from an X terminal... So either I am doing something wrong or what's the reason for having a console much more restricted than X terminals ??

They shouldn't be. Perhaps the ipv6 module is loaded by the time you get X started. As for the FTP, are you doing it as sysadm_t in X too?

Yes, it is probably related to the active mode. But it should be allowed as sysadm_t. We need to check the console functionality carefully as soon as all the other pending patches have been sorted out.

The ipv6 module is disabled. Of course this does not prevent new requests from being made (applications do not know it's disabled)...

Quoted 7 lines
Quoted 3 lines

As for the ftp client, I am doing it from xdm_t under X (from a "graphical" terminal). It's just one of many other things that are not fully functional under the console. We'll get into all that pain soon...

If you're running as a user as xdm_t, it is the wrong domain. If that is why there is a bunch of added xdm_t dbus access in your patches, those rules shouldn't be added.

Finally we got to the point. In fact it sounded so strange to me that stuff was running in xdm_t !

Where did the installation fail then ?

Regards,

Guido