Uploaded image for project: 'Funtoo Linux'
  1. Funtoo Linux
  2. FL-6780

SELinux - long TTY local login with dbus

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None

      replication of https://bugs.gentoo.org/697614

      I believe that it's elogind related it is dbus related:

      after booting the machine and passing valid credentials for any user (including root) I must wait ca. 20 sec for .bash_profile execution

      the problem disappears when I semanage permissive -a initrc_t and reboot.

      This is boot level specific IMO - because when I log in (wait ~20 s) then semanage permissive -a initrc_t and relogin/log in in another TTY - I still need to wait ~20 s

      # audit2why -al | grep 'initrc_t '
      
      #============= initrc_t ==============
      allow initrc_t auditd_t:netlink_audit_socket getattr;
      allow initrc_t auditd_t:unix_stream_socket getattr;
      allow initrc_t nsfs_t:file getattr;
      allow initrc_t udev_t:netlink_kobject_uevent_socket getattr;
      allow initrc_t udev_t:unix_stream_socket getattr;
      
      # sestatus  -v
      SELinux status:                 enabled
      SELinuxfs mount:                /sys/fs/selinux
      SELinux root directory:         /etc/selinux
      Loaded policy name:             strict
      Current mode:                   enforcing
      Mode from config file:          enforcing
      Policy MLS status:              disabled
      Policy deny_unknown status:     denied
      Memory protection checking:     actual (secure)
      Max kernel policy version:      31
      
      Process contexts:
      Current context:                staff_u:sysadm_r:sysadm_t
      Init context:                   system_u:system_r:init_t
      
      File contexts:
      Controlling terminal:           staff_u:object_r:user_devpts_t
      /sbin/init                      system_u:object_r:init_exec_t
      /sbin/agetty                    system_u:object_r:getty_exec_t
      /bin/login                      system_u:object_r:login_exec_t
      /sbin/openrc                    system_u:object_r:rc_exec_t
      /usr/sbin/sshd                  system_u:object_r:sshd_exec_t
      /sbin/unix_chkpwd               system_u:object_r:chkpwd_exec_t
      /etc/passwd                     system_u:object_r:etc_t
      /etc/shadow                     system_u:object_r:shadow_t
      /bin/sh                         system_u:object_r:bin_t -> system_u:object_r:shell_exec_t
      /bin/bash                       system_u:object_r:shell_exec_t
      /usr/bin/newrole                system_u:object_r:newrole_exec_t
      /lib/libc.so.6                  system_u:object_r:lib_t -> system_u:object_r:lib_t
      

      Dirty fix

      semanage permissive -a initrc_t
      

            Unassigned Unassigned
            mrl5 mrl5
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: