Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 24 Aug 2022 15:26:52 +0100
From: Kristina Martsenko <kristina.martsenko@....com>
To: musl@...ts.openwall.com
Subject: [PATCH] epoll: return EINVAL from epoll_create() if size is non-positive

The man page for epoll_create() states that the 'size' argument must be
positive, otherwise EINVAL is returned. musl currently ignores the
argument and does not return EINVAL. Change it to match the man page.

Worth noting that this is needed for an LTP (Linux Test Project) test to
pass (epoll_create02).
---
 src/linux/epoll.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/linux/epoll.c b/src/linux/epoll.c
index 93baa814..e56e8f4c 100644
--- a/src/linux/epoll.c
+++ b/src/linux/epoll.c
@@ -5,6 +5,7 @@
 
 int epoll_create(int size)
 {
+	if (size<=0) return __syscall_ret(-EINVAL);
 	return epoll_create1(0);
 }
 

base-commit: 37e18b7bf307fa4a8c745feebfcba54a0ba74f30
-- 
2.30.2

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.