All of lore.kernel.org
 help / color / mirror / Atom feed
* unix_chkpwd
@ 2003-11-14  8:01 Russell Coker
  2003-11-14 12:38 ` unix_chkpwd Stephen C. Tweedie
  2003-11-14 13:24 ` unix_chkpwd James Morris
  0 siblings, 2 replies; 6+ messages in thread
From: Russell Coker @ 2003-11-14  8:01 UTC (permalink / raw)
  To: SE Linux

When sshd is launched from inetd it inherits the open file handle for the TCP 
socket.  It does not use fcntl(fd, F_SETFD..) to make it close on exec for 
child processes, so when pam_unix.so runs unix_chkpwd (*) the file handle is 
inherited.

We can do one of three things:
1)  dontaudit system_chkpwd_t inetd_t:fd use;
2)  Change sshd to use fcntl() before doing any PAM stuff.
3)  Put code in pam_unix.so to close all file handles after the fork().

Which do you think is best?  2 seems most correct to me, but may be most 
difficult to get accepted upstream.  3 means ~1000 close() calls, which 
doesn't take too long on modern machines.  1 is a hack.

(*) This only happens with my modified PAM and SE Linux policy to prevent all 
login processes from being able to read /etc/shadow directly.

-- 
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-11-14 23:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-14  8:01 unix_chkpwd Russell Coker
2003-11-14 12:38 ` unix_chkpwd Stephen C. Tweedie
2003-11-14 21:59   ` unix_chkpwd Russell Coker
2003-11-14 23:46     ` unix_chkpwd Stephen C. Tweedie
2003-11-14 13:24 ` unix_chkpwd James Morris
2003-11-14 16:57   ` unix_chkpwd Daniel J Walsh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.