[SSSD] fd leak in sssd_pam

Jan Engelhardt jengelh at medozas.de
Thu Jul 28 15:37:39 UTC 2011


Hej,


I am noticing an fd leak with the /usr/lib/sssd/sssd_pam helper program 
(affected versions: 1.4.1--1.5.11). As is usual with weird bugs, this 
happens on one machine while it does not on another, but it at least it
is reproducible on the one :)
What I observe is that for every authentication attempt (may either
fail or success), an fd is left behind::


17:25 mailsrv:/proc/31491/fd # ls -l
[...]
lrwx------ 1 root root 64 Jul 28 17:25 42 -> socket:[228511]
lrwx------ 1 root root 64 Jul 28 17:25 43 -> socket:[227514]
lrwx------ 1 root root 64 Jul 28 17:25 44 -> socket:[228537]
lrwx------ 1 root root 64 Jul 28 17:21 5 -> anon_inode:[eventpoll]
lrwx------ 1 root root 64 Jul 28 17:21 6 -> anon_inode:[eventpoll]
lr-x------ 1 root root 64 Jul 28 17:21 7 -> pipe:[213086]
lrwx------ 1 root root 64 Jul 28 17:21 76 -> socket:[220069]
l-wx------ 1 root root 64 Jul 28 17:21 8 -> pipe:[213086]
lrwx------ 1 root root 64 Jul 28 17:21 88 -> socket:[221781]
lrwx------ 1 root root 64 Jul 28 17:21 9 -> anon_inode:[eventpoll]
17:25 mailsrv:/proc/31491/fd # su - jengelh
17:25 mailsrv:~ > su - jengelh
Passord: 
17:25 mailsrv:~ > logout
17:25 mailsrv:~ > logout
17:25 mailsrv:/proc/31491/fd # ls -l
[...]
lrwx------ 1 root root 64 Jul 28 17:25 42 -> socket:[228511]
lrwx------ 1 root root 64 Jul 28 17:25 43 -> socket:[227514]
lrwx------ 1 root root 64 Jul 28 17:25 44 -> socket:[228537]
lrwx------ 1 root root 64 Jul 28 17:25 46 -> socket:[227688]
[...]


Furthermore, this new socket has no complementary process to have
the other end of socket:[227688] open (anymore):


17:30 mailsrv:/proc # ls -l */fd/* | grep socket:.227688
ls: cannot access 7175/fd/3: No such file or directory
ls: cannot access self/fd/255: No such file or directory
lrwx------ 1 root     root  64 Jul 28 17:25 31491/fd/46 -> socket:[227688]


lsof(8) tells us the name part of the socket for reference:


sssd_pam 31491 root   46u  unix 0xffff88001083a840      0t0 227688 /var/lib/sss/pipes/private/pam



More information about the sssd-devel mailing list