From: Rich Felker <dalias@libc.org>
To: Kate Deplaix <kit-ty-kate@outlook.com>
Cc: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: Re: [musl] [PATCH] Increase NGROUPS_MAX from 32 to 1024
Date: Fri, 13 Sep 2024 12:12:01 -0400 [thread overview]
Message-ID: <20240913161201.GB10433@brightrain.aerifal.cx> (raw)
In-Reply-To: <CWLP265MB4157A01AA054C084992AEDD3BC652@CWLP265MB4157.GBRP265.PROD.OUTLOOK.COM>
On Fri, Sep 13, 2024 at 04:00:52PM +0000, Kate Deplaix wrote:
> The problem is that NGROUPS_MAX is used in downstream projects, not
> sysconf(_SC_NGROUPS_MAX). Notoriously one of the main user of musl
> (Alpine Linux) does not modify this value which makes the whole
> system break completely if a user happens to be added to more than
> 32 groups.
Can you clarify how the whole system is breaking as a result of the
macro value?
> Changing every opensource projects that use NGROUPS_MAX to use
> sysconf(_SC_NGROUPS_MAX) instead doesn't seem like a reasonable
> answer to me, even if it might be the correct one in theory.
>
> I also really don't understand why you want to support 20+ years old
> kernel versions (pre 2.6.4) which aren't even POSIX conformant
> according to your own page:
> https://wiki.musl-libc.org/supported-platforms. I also don't think
> it would also break anything on those platforms anyway if a higher
> value was used. Most uses i've seen use this value to allocate a
> static array, so aside from a couple more bytes of memory used there
> isn't much to lose.
What was established so far is that applications are using NGROUPS_MAX
as an array dimension for an automatic-storage array, which will
immediately blow up with stack overflow if we increased the value to
the kernel value. I'm aware that you proposed just using an arbitrary
lower value like 1024, which might work in practice, but I suspect
there are actually only like 3 or 4 programs that are having any
problem, and they could just be fixed to fallback to allocated storage
if a small constant-size buffer doesn't work. This is normally the way
we work through this kind of problem -- getting to the root cause and
eliminating the technical debt behind it rather than making new
technical debt to work around it.
But in order to evaluate whether this is a good option, and what the
impact of different options would be, we actually need to know what
these programs are.
Rich
next prev parent reply other threads:[~2024-09-13 16:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 23:35 Kate Deplaix
2024-03-11 18:31 ` [musl] " Kate Deplaix
2024-03-12 0:46 ` Rich Felker
2024-04-09 12:54 ` Kate Deplaix
2024-04-09 15:46 ` Thorsten Glaser
2024-04-09 16:26 ` Rich Felker
2024-04-11 1:07 ` [musl] " Rich Felker
2024-04-11 1:51 ` Rich Felker
2024-04-11 2:58 ` Markus Wichmann
2024-04-11 11:44 ` Laurent Bercot
2024-09-13 11:45 ` Kate Deplaix
2024-09-13 14:47 ` Rich Felker
2024-09-13 16:00 ` Kate Deplaix
2024-09-13 16:12 ` Rich Felker [this message]
2024-09-13 18:34 ` Kate Deplaix
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240913161201.GB10433@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=kit-ty-kate@outlook.com \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).