sddm-helper (login screen) hangs with pam_limits maxlogins

Bug #1685898 reported by slodki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sddm (Ubuntu)
New
Undecided
Unassigned

Bug Description

sddm-helper hangs when user tries to login more then maxlogins PAM limit. No mouse/keyboard control possible, only VT change possible.

HOW TO REPRODUCE:

1. Activate PAM maxlogins limit for the user (max 1 session for user basia):

$ echo 'basia - maxlogins 1' | sudo tee /etc/security/limits.d/no-multiple-sessions.conf

2. Start first plasma session from SDDM login screen:

$ loginctl -n 500 session-status 43
[...]
Apr 24 21:12:22 slodki systemd[1]: Started Session 43 of user basia.
Apr 24 21:12:22 slodki sddm-helper[20244]: pam_unix(sddm:session): session opened for user basia by (uid=0)
Apr 24 21:12:22 slodki sddm-helper[20244]: pam_systemd(sddm:session): Cannot create session: Already running in a session
Apr 24 21:12:22 slodki sddm-helper[20244]: pam_kwallet(sddm:session): pam_kwallet: pam_sm_open_session
Apr 24 21:12:22 slodki sddm-helper[20244]: pam_kwallet(sddm:session): pam_kwallet: final socket path: /run/user/1002/kwallet.
Apr 24 21:12:22 slodki sddm-helper[20244]: pam_kwallet5(sddm:session): pam_kwallet5: pam_sm_open_session
Apr 24 21:12:22 slodki sddm-helper[20244]: pam_kwallet5(sddm:session): pam_kwallet5: final socket path: /run/user/1002/kwalle
Apr 24 21:12:22 slodki sddm-helper[20244]: Starting: "/etc/sddm/Xsession" "/usr/bin/startkde"
Apr 24 21:12:22 slodki sddm-helper[20252]: Adding cookie to "/home/basia/.Xauthority"
[...]

3. Switch to new user (new session) and start 2nd user session from SDDM login screen:

$ loginctl -n 500 session-status 46
46 - basia (1002)
           Since: Mon 2017-04-24 21:12:48 CEST; 15min ago
          Leader: 20640 (sddm-helper)
            Seat: seat0; vc9
         Display: :2
         Service: sddm; type x11; class user
         Desktop: KDE
           State: online
            Unit: session-46.scope
                  |-20640 /usr/lib/x86_64-linux-gnu/sddm/sddm-helper --socket /tmp/sddm-auth358e06de-56ea-43cf-a3a2-95f29714e
                  |-20642 /usr/bin/kwalletd --pam-login 15 18 --nofork
                  `-20644 /usr/bin/kwalletd5 --pam-login 15 19

Apr 24 21:12:48 slodki systemd[1]: Started Session 46 of user basia.
Apr 24 21:12:48 slodki sddm-helper[20640]: pam_unix(sddm:session): session opened for user basia by (uid=0)
Apr 24 21:12:48 slodki sddm-helper[20640]: pam_systemd(sddm:session): Cannot create session: Already running in a session
Apr 24 21:12:48 slodki sddm-helper[20640]: pam_kwallet(sddm:session): pam_kwallet: pam_sm_open_session
Apr 24 21:12:48 slodki sddm-helper[20640]: pam_kwallet(sddm:session): pam_kwallet: final socket path: /run/user/1002/kwallet.
Apr 24 21:12:48 slodki sddm-helper[20640]: pam_kwallet5(sddm:session): pam_kwallet5: pam_sm_open_session
Apr 24 21:12:48 slodki sddm-helper[20640]: pam_kwallet5(sddm:session): pam_kwallet5: final socket path: /run/user/1002/kwalle
Apr 24 21:12:48 slodki sddm-helper[20640]: [PAM] openSession: Permission denied

RESULT:
sddm-helper hangs after PAM blocking new user session, logind status of that session is active, must be killed with

$ sudo loginctl terminate-session 46

EXPECTED RESULT:
a) message displayed that session cannot be started due to PAM restrictions
b) logind and X sessions closed
c) seat active session switched to previous one

System: Kubuntu zesty amd64
sddm 0.13.0-1ubuntu5
ibpam-kwallet5 4:5.9.4-0ubuntu1
libpam-modules-bin 1.1.8-3.2ubuntu2
libpam-systemd:amd64 232-21ubuntu3
systemd 232-21ubuntu3

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.