Bruno Haible via Gnulib discussion list <[email protected]> writes:

> Pádraig Brady wrote:
>> This avoids issues on misconfigured systems like with GLIBC:
>>   https://sourceware.org/PR35092
>> This unlikely case can break various assumptions that users expect.
>> E.g. it would trigger buffer overflows in `numfmt -d` or `paste -d`,
>> or mbs_endswidth (numfmt -s).  By returning an error, users can
>> reject the input or fall back to byte oriented processing.
>
> I am opposed to this patch in its entirety.
>
> glibc supports some locales that
>   - are not in use since 2010, or 2015 at the latest, (because the
>     move to UTF-8 locales was completed in the distros around 2010),
>   - require complex processing due to a charset that does not map
>     to Unicode 1:1, requiring stateful conversion in mbrtowc and wcrtomb.
>
> These are:
>   zh_HK.BIG5-HKSCS
>   yi_US.CP1255
> and all locales people could possibly build with the encodings
>   BIG5-HKSCS, CP1255, CP1258, TCVN5712-1, TSCII.
>
> I do not think that it is adequate to add even more complexity to our
> code (in gnulib and other GNU packages) to support something that no one
> has been using for the last 15 years.

It would be nice to at least document this in coreutils and/or gnulib,
as you mention later in your email.

Ideally, coreutils programs would just abort or something if you use one
of those unsupported encodings, but that is probably more effort than it
is worth. It would at least pacify the paranoid security people who
treat every out-of-bounds memory access as an urgent security issue (and
advertising opportunity, in the case of companies). Unfortunately, it is
difficult to argue against them when the locale is still "supported",
i.e., available in distributions, even though no one uses them. This
makes it different than defining bogus locales, for example, which is
obviously a non-issue if they cause programs to crash.

>   * The answer of the Linux kernel people to vulnerabilities in drivers
>     for hardware that was not sold in the last 15 years is now to axe
>     that driver.

I wonder how much of that is due to the Linux Kernel CNA's silly policy
of spamming CVE assignments, though.

>   2. (optionally) through a setlocale() override that falls back to
>      the "C" locale when asked to activate one of the locales mentioned
>      above.

I'm a bit concerned about silently doing that, since the program would
behave unexpectedly.

Collin

Reply via email to