|
Message-ID: <CAMbhsRQM5KWx70Z91SK+Ywe6EvDgcwrgcXb_JvDvNy1Rzn2B0w@mail.gmail.com>
Date: Fri, 10 Feb 2023 14:35:36 -0800
From: Colin Cross <ccross@...gle.com>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: Increase sendmsg internal buffer to match kernel
SCM_MAX_FD limit
On Thu, Feb 9, 2023 at 4:26 PM Rich Felker <dalias@...c.org> wrote:
> The concept of this seems fine, but if the limit was previously 255 on
> supported kernel versions, why stop at 253? It doesn't really cost
> anything to go up large enough that the 255 would work too.
I can use 255.
> As a technical detail, I'd probably also just put the full size
> expression in the [], then use sizeof when you need it later. As
> written, this change makes chbuf[] formally a VLA. The compiler
> probably optimizes it to the same code as if it wasn't a VLA, but
> there's no good reason for it to be a VLA.
Using sizeof with the original buffer would have effectively fixed
this issue, the extra "+1" in the number of chbuf elements adds 16
extra bytes to the buffer on x86_64, which would have been sufficient
to hold the extra fds. It might as well be explicit though so it
doesn't get reduced in the future.
Attached v2.
View attachment "0001-Increase-sendmsg-internal-buffer-to-support-SCM_MAX_.patch" of type "text/x-patch" (1649 bytes)
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.