Follow @Openwall on Twitter for new release announcements and other news
[<prev] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.BSM.4.64L.2512291543140.1510@herc.mirbsd.org>
Date: Mon, 29 Dec 2025 15:46:51 +0000 (UTC)
From: Thorsten Glaser <tg@...bsd.de>
To: musl@...ts.openwall.com
Subject: Re: Re: [PATCH] fix CMSG_NXTHDR result when cmsghdr ends
 exactly before __MHDR_END

Gabriel Hansson dixit:

>To comment a bit further on this: The question is more about whether
>zero-sized payloads should be allowed or not.

I think so.

cmsg lengths are great fun anyway, see for example:
https://github.com/mirabilos/ECN-Bits/blob/master/c/lib/rdmsg.c

Basically, the actual length is the declared length minus the
length of the header… and alignment!

And yes, 0 is possible, it’s basically a flexible array member.

Thankfully, filling them is moderately more straightforward:
https://github.com/mirabilos/ECN-Bits/blob/master/c/lib/mkcmsg.c

I hadn’t tested these with musl, only glibc on Linux, WSL 1 and 2,
MidnightBSD (FreeBSD), NetBSD, Mac OSX, Android.

bye,
//mirabilos
-- 
<ch> you introduced a merge commit        │<mika> % g rebase -i HEAD^^
<mika> sorry, no idea and rebasing just fscked │<mika> Segmentation
<ch> should have cloned into a clean repo      │  fault (core dumped)
<ch> if I rebase that now, it's really ugh     │<mika:#grml> wuahhhhhh

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.