Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZbJ-LzMkjtb5lMwc@pirotess>
Date: Thu, 25 Jan 2024 16:28:47 +0100
From: Ismael Luceno <ismael@...ev.co.uk>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: [PATCH] fix avoidable segfault in catclose

<...>
> Generally in musl, we prefer to trap on UB rather than allowing
> forward progress, especially when the natural default action without
> special casing it is to trap.

POSIX says: "The catclose() function may fail if: [EBADF] The catalog
descriptor is not valid. ..."

Implying a known invalid descriptor like -1, or an invalidated
descriptor should be handled.

Glibc manual says:
"...  Errors can occur if the catalog descriptor catalog_desc is not
valid in which case errno is set to EBADF."

The linux manpage also says that once closed, the descriptor gets
invalidated, which isn't what we're doing here.

-- 
Ismael Luceno
http://iodev.co.uk/

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.