Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-24168

glibc: Rebase qsort to 2.39 upstream version [rhel-9.7]

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • glibc-2.34-211.el9
    • Low
    • Patch
    • 1
    • rhel-pt-c-libs
    • ssg_platform_tools
    • 1
    • False
    • False
    • Hide

      None

      Show
      None
    • Yes
    • PT Libraries 2025 S09
    • Enhancement
    • Hide
      .Hardening of glibc `qsort` behavior on memory allocation failure

      When a memory allocation fails, the `qsort` and‎ `qsort_r` functions of the `glibc` package use a heapsort fallback. This change improves handling of invalid comparison functions and makes performance more predictable if a memory allocation fails.

      Because the fallback is not a stable sort, equal elements can appear in a different order. The C standard does not require stability.
      Show
      .Hardening of glibc `qsort` behavior on memory allocation failure When a memory allocation fails, the `qsort` and‎ `qsort_r` functions of the `glibc` package use a heapsort fallback. This change improves handling of invalid comparison functions and makes performance more predictable if a memory allocation fails. Because the fallback is not a stable sort, equal elements can appear in a different order. The C standard does not require stability.
    • Done
    • Done
    • Done
    • All
    • None

      The upstream implementation of qsort and qsort_r improves hardening against buggy comparison functions, on the code path taken after a malloc failure.

      We should consider backporting this change into Red Hat Enterprise Linux 9.

      Changes from 2.39 at least up to and including this commit should be included:

      commit dfa3394a605c8f6f25e4f827789bc89eca1d206c
      Author: Xi Ruoyao <xry111@xry111.site>
      Date:   Tue Jan 23 04:29:18 2024 +0800
      
          qsort: Fix a typo causing unnecessary malloc/free (BZ 31276)
      

              skolosov@redhat.com Sergey Kolosov
              fweimer@redhat.com Florian Weimer
              Arjun Shankar Arjun Shankar
              Sergey Kolosov Sergey Kolosov
              Malhar Jivrajani Malhar Jivrajani
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

                Created:
                Updated: