• Miklos Szeredi's avatar
    [NET]: File descriptor loss while receiving SCM_RIGHTS · effee6a0
    Miklos Szeredi authored
    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: default avatarMiklos Szeredi <miklos@szeredi.hu>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    effee6a0
compat.c 18.5 KB