public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fweimer at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug locale/28255] A locale with zero collation rules cause fnmatch,  regexec, and regcomp failures.
Date: Thu, 16 Sep 2021 20:18:02 +0000	[thread overview]
Message-ID: <bug-28255-131-BDqcC8JMzo@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28255-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28255

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-
                 CC|                            |fweimer at redhat dot com
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |2.35
         Resolution|---                         |FIXED

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
Fixed for glibc 2.35 via:

commit f5117c6504888fab5423282a4607c552b90fd3f9
Author: Carlos O'Donell <carlos@redhat.com>
Date:   Thu Jul 29 22:45:39 2021 -0400

    Add 'codepoint_collation' support for LC_COLLATE.

    Support a new directive 'codepoint_collation' in the LC_COLLATE
    section of a locale source file. This new directive causes all
    collation rules to be dropped and instead STRCMP (strcmp or
    wcscmp) is used for collation of the input character set. This
    is required to allow for a C.UTF-8 that contains zero collation
    rules (minimal size) and sorts using code point sorting.

    To date the only implementation of a locale with zero collation
    rules is the C/POSIX locale. The C/POSIX locale provides
    identity tables for _NL_COLLATE_COLLSEQMB and
    _NL_COLLATE_COLLSEQWC that map to ASCII even though it has zero
    rules. This has lead to existing fnmatch, regexec, and regcomp
    implementations that require these tables. It is not correct
    to use these tables when nrules == 0, but the conservative fix
    is to provide these tables when nrules == 0. This assures that
    existing static applications using a new C.UTF-8 locale with
    'codepoint_collation' at least have functional range expressions
    with ASCII e.g. [0-9] or [a-z]. Such static applications would
    not have the fixes to fnmatch, regexec and regcomp that avoid
    the use of the tables when nrules == 0. Future fixes to fnmatch,
    regexec, and regcomp would allow range expressions to use the
    full set of code points for such ranges.

    Tested on x86_64 and i686 without regression.

    Reviewed-by: Florian Weimer <fweimer@redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  reply	other threads:[~2021-09-16 20:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20 22:05 [Bug locale/28255] New: " carlos at redhat dot com
2021-09-16 20:18 ` fweimer at redhat dot com [this message]
2021-12-16 22:32 ` [Bug locale/28255] " carlos at redhat dot com
2021-12-16 22:32 ` carlos at redhat dot com

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=bug-28255-131-BDqcC8JMzo@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).