Bug 616823 - PAM usage of sudo is broken
PAM usage of sudo is broken
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: sudo (Show other bugs)
14
All Linux
low Severity medium
: ---
: ---
Assigned To: Daniel Kopeček
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-21 09:42 EDT by Lennart Poettering
Modified: 2010-09-15 03:08 EDT (History)
3 users (show)

See Also:
Fixed In Version: sudo-1.7.4p4-1.fc14
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-09-15 03:08:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Lennart Poettering 2010-07-21 09:42:15 EDT
sudo uses PAM incorrectly: it calls pam_open_session() immediately followed by
pam_close_session() and only then exec()s the actual process. 

pam_close_session() must be closed after the process terminates again, not
before. This issue confused a number of PAM modules quite a bit.

login(1) does that correctly. After calling pam_open_session() it forks, and
then in the parent process waits for the child to terminate and then calls
pam_close_session(). 

http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=blob;f=login-utils/login.c;h=1550388c4574207857ae6843041eeff3cba52d39;hb=HEAD#l1166

sudo must follow the same scheme.
Comment 1 Lennart Poettering 2010-07-21 09:43:02 EDT
http://www.gratisoft.us/bugzilla/show_bug.cgi?id=421
Comment 2 Karel Zak 2010-07-21 10:29:12 EDT
sudo(8) does not fork(), it calls exec() only. This is feature...

It's necessary to start PAM session, because some resources are defined/restricted during session initialization (e.g. pam_limit). For more details see bug #154511.
Comment 3 Daniel Kopeček 2010-07-21 14:01:59 EDT
Upstream fix: http://www.sudo.ws/repos/sudo/rev/fb3d7de50a05
Comment 4 Bug Zapper 2010-07-30 08:43:32 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 5 Fedora Update System 2010-09-07 12:14:29 EDT
sudo-1.7.4p4-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/sudo-1.7.4p4-1.fc14
Comment 6 Fedora Update System 2010-09-07 14:36:59 EDT
sudo-1.7.4p4-1.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update sudo'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/sudo-1.7.4p4-1.fc14
Comment 7 Fedora Update System 2010-09-15 03:08:49 EDT
sudo-1.7.4p4-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

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