commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 15/26: pflocal: fix port leak when receiving port rights


From: Samuel Thibault
Subject: [hurd] 15/26: pflocal: fix port leak when receiving port rights
Date: Sat, 02 Nov 2013 14:44:45 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit 2e5f5e3c6d3716aec736474a198de5f7746a5450
Author: Richard Braun <address@hidden>
Date:   Fri Oct 18 01:16:08 2013 +0200

    pflocal: fix port leak when receiving port rights
    
    The socket_send and socket_recv routines can be used to transmit port
    rights along data. Unfortunately, pflocal retains a copy of these rights
    in the socket_recv RPC. These lingering references would in turn lead to
    other leaks in servers waiting for a no-sender notification to clean
    their resources. Since these copied rights aren't used at all by the
    server, it is safe to simply move them to the recipient instead.
    
    * pflocal/socket.c (S_socket_recv): Transmit port rights using
    MACH_MSG_TYPE_MOVE_SEND transfer type instead of MACH_MSG_TYPE_COPY_SEND.
---
 pflocal/socket.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pflocal/socket.c b/pflocal/socket.c
index 6723734..c5c9735 100644
--- a/pflocal/socket.c
+++ b/pflocal/socket.c
@@ -401,7 +401,7 @@ S_socket_recv (struct sock_user *user,
     /* Setup mach ports for return.  */
     {
       *addr_type = MACH_MSG_TYPE_MAKE_SEND;
-      *ports_type = MACH_MSG_TYPE_COPY_SEND;
+      *ports_type = MACH_MSG_TYPE_MOVE_SEND;
       if (source_addr)
        {
          *addr = ports_get_right (source_addr);

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]