From 0c7472cbbcd18dba7a9be4d2f47256e97dd07f5d Mon Sep 17 00:00:00 2001 From: borysp Date: Wed, 22 Jul 2020 17:52:15 +0200 Subject: [PATCH] [LibOS] Fix incorrect argument check in socketpair --- LibOS/shim/src/sys/shim_pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibOS/shim/src/sys/shim_pipe.c b/LibOS/shim/src/sys/shim_pipe.c index 5b8722e2..fa094f7c 100644 --- a/LibOS/shim/src/sys/shim_pipe.c +++ b/LibOS/shim/src/sys/shim_pipe.c @@ -152,7 +152,7 @@ int shim_do_socketpair(int domain, int type, int protocol, int* sv) { if (domain != AF_UNIX) return -EAFNOSUPPORT; - if (type != SOCK_STREAM) + if ((type & ~(SOCK_NONBLOCK | SOCK_CLOEXEC)) != SOCK_STREAM) return -EPROTONOSUPPORT; if (!sv || test_user_memory(sv, 2 * sizeof(int), true))