public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] hurd: Do not take any flag from the CMSG_DATA
@ 2023-04-24 22:17 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2023-04-24 22:17 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=323fe6a1a9204e2126df63cb81a88831d1cdeaf5

commit 323fe6a1a9204e2126df63cb81a88831d1cdeaf5
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Tue Apr 25 00:14:58 2023 +0200

    hurd: Do not take any flag from the CMSG_DATA
    
    As fixed in 0822e3552a78 ("hurd: Don't pass FD_CLOEXEC in CMSG_DATA"),
    senders currently don't have any flag to pass.  We shouldn't blindly take
    random flags that senders could be erroneously giving us.

Diff:
---
 sysdeps/mach/hurd/recvmsg.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sysdeps/mach/hurd/recvmsg.c b/sysdeps/mach/hurd/recvmsg.c
index e06b0fe3ba..4254dca627 100644
--- a/sysdeps/mach/hurd/recvmsg.c
+++ b/sysdeps/mach/hurd/recvmsg.c
@@ -201,8 +201,10 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags)
 	    err = reauthenticate (ports[i], &newports[newfds]);
 	    if (err)
 	      goto cleanup;
+	    /* We do not currently take any flag from the sender.  */
 	    fds[j] = opened_fds[newfds] = _hurd_intern_fd (newports[newfds],
-							   fds[j] | fd_flags,
+							   (fds[j] & 0)
+							   | fd_flags,
 							   0);
 	    if (fds[j] == -1)
 	      {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-24 22:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-24 22:17 [glibc] hurd: Do not take any flag from the CMSG_DATA Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).