Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACwv9n3pdhFHHNMDuS_OB8X5iq+crdDixLy35n2yjr4kJAz+1g@mail.gmail.com>
Date: Mon, 29 Dec 2025 14:06:13 +0100
From: Gabriel Hansson <gabrielhansson00@...il.com>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] fix CMSG_NXTHDR result when cmsghdr ends exactly before __MHDR_END

On Sat, 27 Dec 2025 at 18:21, Gabriel Hansson
<gabrielhansson00@...il.com> wrote:

> Boundary check should not evaluate to null when `cmsg_addr + cmsg_len +
> sizeof(cmsghdr) == mhdr_addr + mhdr.msg_controllen` since the bytes in use are
> always len - 1.

To comment a bit further on this: The question is more about whether zero-sized
payloads should be allowed or not. Most libc implementations allow this, glibc
and most from the BSD-family from what I can tell. POSIX 1003.1-2024 doesn't
say much other than a null pointer may be returned if the ancillary data extends
**beyond** the end of the ancillary data. [^1]

To be honest, though, I personally have little need for zero-sized
payloads. Came
here because some compatibility CI tests began failing in Rust's libc
crate. It's
absolutely no biggie for us to create to a separate CMSG_NXTHDR implementation
when targeting musl. Just thought it doesn't hurt to raise some
awareness regarding
the difference. I trust whichever decision you decide to take from this :)

[^1]: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_socket.h.html#top

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.