From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1000 invoked from network); 24 Aug 2022 23:34:53 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 24 Aug 2022 23:34:53 -0000 Received: (qmail 30062 invoked by uid 550); 24 Aug 2022 23:34:51 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 30027 invoked from network); 24 Aug 2022 23:34:50 -0000 Date: Wed, 24 Aug 2022 19:34:37 -0400 From: Rich Felker To: Markus Wichmann Cc: musl@lists.openwall.com Message-ID: <20220824233437.GN7074@brightrain.aerifal.cx> References: <20220824142652.1424306-1-kristina.martsenko@arm.com> <20220824184704.GA1923@voyager> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220824184704.GA1923@voyager> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [PATCH] epoll: return EINVAL from epoll_create() if size is non-positive On Wed, Aug 24, 2022 at 08:47:04PM +0200, Markus Wichmann wrote: > On Wed, Aug 24, 2022 at 03:26:52PM +0100, Kristina Martsenko wrote: > > 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). > > I am wondering if this change is sensible. On musl, the size argument is > never handed to the kernel. Failing for nonpositive arguments may be in > the spec, but it might make users assume the argument is actually used. > But it isn't. epoll_create() always calls epoll_create1(), and that > function falls back to the epoll_create syscall with a constant argument > of 1 if epoll_create1 is not available. Being that it's documented to fail with EINVAL for nonpositive arguments, I think we should do that, even if the argument is otherwise ignored. Rich