Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error setting user password after package layering with rpm-ostree #814

Closed
mike-nguyen opened this issue Apr 26, 2017 · 7 comments
Closed

Error setting user password after package layering with rpm-ostree #814

mike-nguyen opened this issue Apr 26, 2017 · 7 comments
Assignees
Labels
bug

Comments

@mike-nguyen
Copy link

@mike-nguyen mike-nguyen commented Apr 26, 2017

I am getting "Authentication token manipulation error" when changing user's password after using rpm-ostree package layering (I was able to change it before package layering) on Fedora Atomic Host Continuous. The logs point to an selinux issue. If I setenforce 0, I am able to change the password. This might be related to e8efd1c

#  echo $pw | passwd atomic-user-2014 --stdin
Changing password for user atomic-user-2014.
passwd: Authentication token manipulation error
# setenforce 0
# echo $pw | passwd atomic-user-2014 --stdin
Changing password for user atomic-user-2014.
passwd: all authentication tokens updated successfully.
# rpm-ostree status
State: idle
Deployments:
● custom:fahc/25/x86_64/buildmaster
             Version: 25.175 (2017-04-25 17:27:37)
          BaseCommit: 0f9110627862710a40b2c701ee1a829dfadf7e62b3793bd3c9c2e1054f339622
     LayeredPackages: wget

  custom:fahc/25/x86_64/buildmaster
             Version: 25.175 (2017-04-25 17:27:37)
              Commit: 0f9110627862710a40b2c701ee1a829dfadf7e62b3793bd3c9c2e1054f339622
# rpm -q ostree
ostree-2017.4.20-e8efd1c8dcaad8fbd3b05c400972d237406263e7.d8b864b502c5853efda6e8f7d1b0ebff84b581a3.fc25.x86_64

Journal during error:

Apr 26 14:16:57 fedora.localdomain audit[2057]: AVC avc:  denied  { write } for  pid=2057 comm="passwd" name="etc" dev="dm-0" ino=16873451 scontext=unconfined_u:unconfined_r:passwd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:root_t:s0 tclass=dir permissive=0
Apr 26 14:16:57 fedora.localdomain audit[2057]: SYSCALL arch=c000003e syscall=2 success=no exit=-13 a0=7f0908ff8693 a1=241 a2=1b6 a3=1 items=0 ppid=2035 pid=2057 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=7 comm="passwd" exe="/usr/bin/passwd" subj=unconfined_u:unconfined_r:passwd_t:s0-s0:c0.c1023 key=(null)
Apr 26 14:16:57 fedora.localdomain audit: PROCTITLE proctitle=7061737377640061746F6D69632D757365722D32303134002D2D737464696E
Apr 26 14:16:57 fedora.localdomain audit[2057]: USER_CHAUTHTOK pid=2057 uid=0 auid=1000 ses=7 subj=unconfined_u:unconfined_r:passwd_t:s0-s0:c0.c1023 msg='op=PAM:chauthtok grantors=? acct="atomic-user-2014" exe="/usr/bin/passwd" hostname=fedora.localdomain addr=? terminal=pts/1 res=failed'
Apr 26 14:17:00 fedora.localdomain audit[2057]: USER_CHAUTHTOK pid=2057 uid=0 auid=1000 ses=7 subj=unconfined_u:unconfined_r:passwd_t:s0-s0:c0.c1023 msg='op=change password id=2014 exe="/usr/bin/passwd" hostname=fedora.localdomain addr=? terminal=pts/1 res=failed'

Test Run Log: log

@cgwalters cgwalters self-assigned this Apr 26, 2017
@cgwalters
Copy link
Member

@cgwalters cgwalters commented Apr 26, 2017

Yep, very likely to be a regression from e8efd1c indeed. Will look.

@cgwalters cgwalters added the bug label Apr 26, 2017
@dustymabe
Copy link
Contributor

@dustymabe dustymabe commented Apr 26, 2017

wow, great test and investigation

@mike-nguyen
Copy link
Author

@mike-nguyen mike-nguyen commented Apr 26, 2017

@miabbott tracked down the commit based on the info I found. He is a 🕵️‍♂️

miabbott added a commit to miabbott/sig-atomic-buildscripts that referenced this issue Apr 26, 2017
I realized that we did not encounter ostreedev/ostree#814 on CAHC,
which was odd because we should be building `ostree` from source.  The
latest CAHC composes seem to be pulling `ostree` from the
`atomic7-testing`, so let's just exclude it from the repo.
cgwalters added a commit to CentOS/sig-atomic-buildscripts that referenced this issue Apr 26, 2017
* Exclude 'ostree' from atomic7-testing repo

I realized that we did not encounter ostreedev/ostree#814 on CAHC,
which was odd because we should be building `ostree` from source.  The
latest CAHC composes seem to be pulling `ostree` from the
`atomic7-testing`, so let's just exclude it from the repo.

* fixup! Exclude 'ostree' from atomic7-testing repo
@cgwalters
Copy link
Member

@cgwalters cgwalters commented Apr 26, 2017

The root cause here (so to speak) is that a lot of files and directories are labeled root_t instead of etc_t.

Still debugging this; it's pretty interesting that doing:

ostree admin deploy fahc:fahc/25/x86_64/buildmaster

doesn't trigger the behavior, but it should be the same code path via rpm-ostree layering.

@cgwalters
Copy link
Member

@cgwalters cgwalters commented Apr 26, 2017

Somehow, is_selinux_enabled() is returning 0 on the second sepolicy initialization for rpm-ostree. We do a first initialization for package layering. Possibly related to setting the root twice?

cgwalters added a commit to cgwalters/ostree that referenced this issue Apr 26, 2017
This fixes a regression from:
ostreedev#797
which is really due to an underlying bug in libselinux which
we're working around:
http://marc.info/?l=selinux&m=149323809332417&w=2

We drop the per-policy instance variable, since the SELinux state
is *really* per-kernel.

Closes: ostreedev#814
@cgwalters
Copy link
Member

@cgwalters cgwalters commented Apr 26, 2017

PR in #815

@mike-nguyen
Copy link
Author

@mike-nguyen mike-nguyen commented Apr 27, 2017

The tests are passing again on Fedora Atomic Host Continuous. Awesome work @cgwalters!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants