[NET]: File descriptor loss while receiving SCM_RIGHTS
authorMiklos Szeredi <miklos@szeredi.hu>
Tue, 10 Oct 2006 04:42:14 +0000 (21:42 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 12 Oct 2006 06:59:48 +0000 (23:59 -0700)
commiteffee6a00034a8d83a6dea6d221820d87364ac21
tree7008bcfd7f2c2ece8e58365ff970a90292b6af08
parent6aa2551cf135f1d246d31482adc8c679eeea3a83
[NET]: File descriptor loss while receiving SCM_RIGHTS

If more than one file descriptor was sent with an SCM_RIGHTS message,
and on the receiving end, after installing a nonzero (but not all)
file descritpors the process runs out of fds, then the already
installed fds will be lost (userspace will have no way of knowing
about them).

The following patch makes sure, that at least the already installed
fds are sent to userspace.  It doesn't solve the issue of losing file
descriptors in case of an EFAULT on the userspace buffer.

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/compat.c
net/core/scm.c