[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
- [hurd] 06/26: libfshelp: properly free active translator entries, (continued)
- [hurd] 06/26: libfshelp: properly free active translator entries, Samuel Thibault, 2013/11/02
- [hurd] 21/26: configure.ac: properly escape the test for X11/keysymdef.h, Samuel Thibault, 2013/11/02
- [hurd] 25/26: libports: fix error handling in _ports_create_port_internal, Samuel Thibault, 2013/11/02
- [hurd] 14/26: libdiskfs: fix removal of socket nodes, Samuel Thibault, 2013/11/02
- [hurd] 22/26: exec: Remove the remaining BFD related bits, Samuel Thibault, 2013/11/02
- [hurd] 13/26: pflocal: fix destruction of explicitely bound sockets, Samuel Thibault, 2013/11/02
- [hurd] 20/26: Make boot script accept more fsck values, Samuel Thibault, 2013/11/02
- [hurd] 19/26: Add xenl to hurd.ti, Samuel Thibault, 2013/11/02
- [hurd] 18/26: Make CUD more usual, Samuel Thibault, 2013/11/02
- [hurd] 17/26: Make boot script reboot when fsck told so, Samuel Thibault, 2013/11/02
- [hurd] 15/26: pflocal: fix port leak when receiving port rights,
Samuel Thibault <=
- [hurd] 16/26: pflocal: fix message flags on receive, Samuel Thibault, 2013/11/02