From: Kate Deplaix <kit-ty-kate@outlook.com>
To: Rich Felker <dalias@libc.org>
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 18:34:00 +0000 [thread overview]
Message-ID: <CWLP265MB4157E1FF56C0D015FB6DFA63BC652@CWLP265MB4157.GBRP265.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20240913161201.GB10433@brightrain.aerifal.cx>
[-- Attachment #1: Type: text/plain, Size: 3673 bytes --]
> Can you clarify how the whole system is breaking as a result of the
macro value?
i just tried again and the issue seems to come from initgroups (https://git.busybox.net/busybox/tree/libbb/change_identity.c?h=1_36_stable) so your commit might have fixed this particular issue.
Would it be possible to have a release of musl? Or alternatively is there a simple way to install musl master on Alpine to test if it fixed that problem?
The way to reproduce this issue is to simply:
# su - user
$ exit
# addgroup user kvm
# echo $?
0
# groups user | wc -w
33
# su - user
su: can't set groups
If you do that to root you can't login anymore and you've locked yourself out of your system. From what i remember on reboot you can't login to other users either.
> getting to the root cause and eliminating the technical debt behind it rather than making new technical debt to work around it.
Sure, i do agree that's the ideal thing to do. However this only works if someone (or a group of people) is actively working on fixing it everywhere. I personally don't have time to do that outside of OCaml.
> but I suspect there are actually only like 3 or 4 programs that are having any problem
I disagree. Just glancing through https://codesearch.debian.net/ the issue can be seen in Pulseaudio, Sendmail, libcap2, OCaml, lynx, openafs, thunar, nemo, nautilus, opendoas, …
________________________________
From: Rich Felker <dalias@libc.org>
Sent: 13 September 2024 17:12
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
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
[-- Attachment #2: Type: text/html, Size: 6357 bytes --]
prev parent reply other threads:[~2024-09-13 18:34 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
2024-09-13 18:34 ` Kate Deplaix [this message]
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=CWLP265MB4157E1FF56C0D015FB6DFA63BC652@CWLP265MB4157.GBRP265.PROD.OUTLOOK.COM \
--to=kit-ty-kate@outlook.com \
--cc=dalias@libc.org \
--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).