hurd: Don't leak __hurd_reply_port0
authorSergey Bugaev <bugaevc@gmail.com>
Sun, 19 Mar 2023 15:10:10 +0000 (18:10 +0300)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 10 Apr 2023 22:24:40 +0000 (00:24 +0200)
commitcd019ddd892e182277fadd6aedccc57fa3923c8d
treecfcc71948e40bd484e00e3105153ec305e6b19a8
parent747812349d42427c835aeac987aa67641d84f1ad
hurd: Don't leak __hurd_reply_port0

Previously, once we set up TLS, we would implicitly switch from using
__hurd_reply_port0 to reply_port inside the TCB, leaving the former
unused. But we never deallocated it, so it got leaked.

Instead, migrate the port into the new TCB's reply_port slot. This
avoids both the port leak and an extra syscall to create a new reply
port for the TCB.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Message-Id: <20230319151017.531737-28-bugaevc@gmail.com>
sysdeps/mach/hurd/i386/tls.h
sysdeps/mach/hurd/x86_64/tls.h