Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 191665
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: SE Linux Bugs <selinux@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Arthur Hagen <art-gt@broomstick.com>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 191665 depends on: Show dependency tree
Bug 191665 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-09-08 08:31 0000
After upgrading to openssh-4.7, login user/role assignment in selinux no longer
works, and non-root users registered with other selinux user mappings get
mapped to the default selinux user/role (normally user_u).

Reproducible: Always

Steps to Reproduce:
tree ~ # id -Z
root:sysadm_r:sysadm_t
tree ~ # rlpkg -a
[...]
tree ~ # sestatus -v | egrep '(login|ssh|newrole)'
/bin/login                      system_u:object_r:login_exec_t
/usr/sbin/sshd                  system_u:object_r:sshd_exec_t
/usr/bin/newrole                system_u:object_r:newrole_exec_t
tree ~ # sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 21
Policy from config file:        strict
tree ~ # semanage login -a -s staff_u arth
tree ~ # semanage login -l

Login Name                SELinux User

__default__               user_u
arth                      staff_u
root                      root
tree ~ # semanage user -l
SELinux User    SELinux Roles

root            sysadm_r staff_r
staff_u         sysadm_r staff_r
sysadm_u        sysadm_r
system_u        system_r
user_u          user_r
tree ~ # ssh arth@localhost
Password:
Last login: Sat Sep  8 04:20:31 2007 from localhost
arth@tree ~ $ 

Actual Results:  
arth@tree ~ $ id -Z
user_u:user_r:user_t
arth@tree ~ $ newrole -r sysadm_r
user_u:sysadm_r:sysadm_t is not a valid context


Expected Results:  
arth@tree ~ $ id -Z
staff_u:staff_r:staff_t
arth@tree ~ $ newrole -r sysadm_r
Authenticating arth
Password:
arth@tree ~ id -Z
staff_u:sysadm_r:sysadm_t


If downgrading to net-misc/openssh-4.6_p1-r3 and restarting sshd, problem
disappears.

Due to how selinux prevents privilege escalation, this problem means that users
without a console or other physical access to a box might be locked out from
using root, and thus correct the problem.

------- Comment #1 From Xake 2008-01-26 10:07:00 0000 -------
This is only a problem for strict profile, right?
with targeted you there is no need to change user role, or have I misunderstood
something?

------- Comment #2 From gentoo@immerda.ch 2008-02-08 13:15:37 0000 -------
Any progress? i'd like to fix it because of
 GLSA 200711-02: Synopsis: A flaw has been discovered in OpenSSH which could
allow a local attacker to bypass security restrictions. 
 Announced on: November 01, 2007
 Vulnerable:        <4.7
 Unaffected:        >=4.7

------- Comment #3 From Fixinko 2008-02-17 10:43:23 0000 -------
I've tried openssh-4.7_p1-r4, and openssh still break selinux role assignment
:-(

------- Comment #4 From GNUtoo@no-log.org 2008-03-30 01:05:23 0000 -------
that is very problematic because of the new security bug in openssh:
http://bugs.gentoo.org/show_bug.cgi?id=214985

------- Comment #5 From Arthur Hagen 2008-03-30 12:43:18 0000 -------
Xake:  It is a problem with targeted too.  (Targeted only limits selinux to
certain packages -- you still use roles for THOSE packages).

Yes, this is becoming unbearable.  Almost seven months now, and no indication
that this is even looked at.  selinux users still have to mask all newer
openssh versions and use an old version (4.6p1) with known vulnerabilities.

------- Comment #6 From Chris PeBenito 2008-04-01 15:41:05 0000 -------
fixed in -r5

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug