Bug 1312283 - MLS: semanage adds staff_u with wrong range
Summary: MLS: semanage adds staff_u with wrong range
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: policycoreutils
Version: 32
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Petr Lautrbach
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1281852 1554360
TreeView+ depends on / blocked
 
Reported: 2016-02-26 10:34 UTC by Miroslav Vadkerti
Modified: 2020-07-27 20:36 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1349754 1554360 (view as bug list)
Environment:
Last Closed: 2020-07-27 20:36:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miroslav Vadkerti 2016-02-26 10:34:12 UTC
Description of problem:
The command:
# { useradd stafftest; semanage user -l | grep staff_u; semanage login -a -s staff_u stafftest; semanage login -l | grep stafftest; userdel -Z stafftest; } 2>/dev/null

On Fedora adds stafftest with range SystemLow, instead of expected SystemLow-SystemHigh
staff_u         user       SystemLow  SystemLow-SystemHigh           auditadm_r secadm_r staff_r sysadm_r system_r lspp_test_r
stafftest            staff_u              SystemLow            *

On RHEL7 this works nicely:
staff_u         user       SystemLow  SystemLow-SystemHigh           auditadm_r staff_r lspp_test_r secadm_r sysadm_r system_r
stafftest            staff_u              SystemLow-SystemHigh *

Version-Release number of selected component (if applicable):
policycoreutils-2.4-18.fc23

How reproducible:
100%

Steps to Reproduce:
1. Install Fedora in MLS
2. { useradd stafftest; semanage user -l | grep staff_u; semanage login -a -s staff_u stafftest; semanage login -l | grep stafftest; userdel -Z stafftest; } 2>/dev/null

Actual results:
stafftest            staff_u              SystemLow            *

Expected results:
stafftest            staff_u              SystemLow-SystemHigh *

Comment 1 Petr Lautrbach 2016-02-26 12:15:14 UTC
You need to use "-r RANGE" if you don't want to use a default value which is "s0", see man semanage-login:

       -r RANGE, --range RANGE
              MLS/MCS Security Range (MLS/MCS Systems only) SELinux Range for SELinux login mapping defaults to the SELinux user record range. SELinux  Range  for  SELinux user defaults to s0.

# semanage login -a -s staff_u -r s0-s0:c0.c1023 stafftest      

# semanage login -l | grep stafftest
stafftest            staff_u              s0-s0:c0.c1023       *

Comment 2 Petr Lautrbach 2016-02-26 12:54:14 UTC
It looks like semanage is inconsistent with useradd tool now. While semanage login uses s0 as default, useradd uses seuser's mls range. semanage was change to use seuser's mls default in rhel-6 and rhel-7 but it seems to me that it has never been changed in Fedora/upstream.

Comment 3 Fedora End Of Life 2016-11-24 15:46:43 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2016-12-20 19:02:58 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 Jiri Jaburek 2017-01-02 15:05:20 UTC
The "incosistency" between 'semanage login -a' and 'useradd -Z' still seems to be present on F25 at least.

First, the "MLS/MCS Level" of 'semanage user' is completely ignored when adding new 'semanage login' entries via semanage/useradd. Not sure what is the intended use case as the documentation in semanage-user(8) is rather brief.

Second, 'semanage login' seems to always add new entries with s0 and 'useradd -Z' always with the range copied from 'semanage user'.

Comment 6 Fedora End Of Life 2017-11-16 19:53:09 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 7 Fedora End Of Life 2017-12-12 11:03:38 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 8 Ben Cotton 2019-05-02 19:37:32 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Ben Cotton 2019-05-28 23:58:18 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.