]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
3 months agolocale: Fix UB on VLA allocation
Adhemerval Zanella [Tue, 22 Apr 2025 13:50:13 +0000 (10:50 -0300)] 
locale: Fix UB on VLA allocation

Both level 2 and level 3 sizes can be zero, which triggers a 0-size
VLA.  Reorganize the code to allocate the VLA iff sizes are positive.

3 months agolibio: Fix UB __libio_codecvt_length
Adhemerval Zanella [Tue, 22 Apr 2025 12:02:54 +0000 (09:02 -0300)] 
libio: Fix UB __libio_codecvt_length

To avoid a 0 size VLA.

3 months agoiconv: Fix UB on iconv/tst-translit-mchar
Adhemerval Zanella [Mon, 21 Apr 2025 20:51:37 +0000 (17:51 -0300)] 
iconv: Fix UB on iconv/tst-translit-mchar

Building with ubsan, the test triggers:

UBSAN: Undefined behaviour in programs/locfile.c:598:3 null pointer passed as argument 2, nonnull attribute declared at unknown:0:0

The obstack_grow is only define for size > 0.

3 months agoiconv: Fix UB on find_derivation
Adhemerval Zanella [Mon, 21 Apr 2025 20:49:31 +0000 (17:49 -0300)] 
iconv: Fix UB on find_derivation

The cost addition might overflow since the default value is
LONG_INT.  Use wrap addition instead.

3 months agomath: Fix UB in setayloadf
Adhemerval Zanella [Mon, 21 Apr 2025 18:15:07 +0000 (15:15 -0300)] 
math: Fix UB in setayloadf

The code can shift the 1U for value larger than 31 depending of
the exponent value.  Add a check prior the shift.

3 months agomath: Fix UB in setayload
Adhemerval Zanella [Mon, 21 Apr 2025 18:12:21 +0000 (15:12 -0300)] 
math: Fix UB in setayload

The code can shift the 1ULL for value larger than 63 depending of
the exponent value.  Add a check prior the shift.

3 months agomath: Remove UB from float128 ilogbf
Adhemerval Zanella [Mon, 21 Apr 2025 17:43:49 +0000 (14:43 -0300)] 
math: Remove UB from float128 ilogbf

The subnormal exponent calculation invokes UB by left shifting the
high or lower work.  Use unsigned values and stdc_leading_zeros
instead.

3 months agopowerpc: Use generic ilogb/ilogbf and refactor ilogbf128
Adhemerval Zanella [Tue, 29 Apr 2025 16:30:04 +0000 (13:30 -0300)] 
powerpc: Use generic ilogb/ilogbf and refactor ilogbf128

The powerpc64 leverages the use of xsxexpdp and xsxexpqp for
for both ilogb/ilogbf for float, double, and float128 types.
However with the new generic ilogb/ilogbf, this is not really
a gain anymore.

On POWER9 with gcc-13, the xsxexpdp/xsxexpqp shows:

$ ./benchtests/bench-ilogb
  "ilogb": {
   "subnormal": {
    "duration": 5.08829e+08,
    "iterations": 4.4588e+07,
    "max": 18.761,
    "min": 6.7005,
    "mean": 11.4118
   },
   "normal": {
    "duration": 5.04674e+08,
    "iterations": 9.9596e+07,
    "max": 7.386,
    "min": 5.0505,
    "mean": 5.06722
   }
$ ./benchtests/bench-ilogbf
  "ilogbf": {
   "subnormal": {
    "duration": 5.04918e+08,
    "iterations": 9.8732e+07,
    "max": 7.1595,
    "min": 5.0475,
    "mean": 5.11402
   },
   "normal": {
    "duration": 5.04971e+08,
    "iterations": 9.8744e+07,
    "max": 7.771,
    "min": 5.048,
    "mean": 5.11394
   }
  }

While the new generic implementation shows:

$ ./benchtests/bench-ilogb
  "ilogb": {
   "subnormal": {
    "duration": 5.05389e+08,
    "iterations": 9.2644e+07,
    "max": 11.0355,
    "min": 5.4255,
    "mean": 5.45517
   },
   "normal": {
    "duration": 5.04667e+08,
    "iterations": 1.02388e+08,
    "max": 9.758,
    "min": 4.8945,
    "mean": 4.92897
   }
  }[azanella@cfarm135 powerpc64le-linux-gnu-power9-gcc13]$ ./benchtests/bench-ilogbf
  "ilogbf": {
   "subnormal": {
    "duration": 5.05409e+08,
    "iterations": 9.238e+07,
    "max": 7.69,
    "min": 5.442,
    "mean": 5.47098
   },
   "normal": {
    "duration": 5.0456e+08,
    "iterations": 1.02012e+08,
    "max": 6.84,
    "min": 4.922,
    "mean": 4.94609
   }
  }

The xsxexpdp/xsxexpqp also adds some extra code size overhead since it
uses the generic ilogb/ilogbf for 0/inf/NaN handling.  It is still kept
for float128, and this patch also optimizes it to avoid need to call
extra generic symbol to handle not number inputs.

On same hardware (POWER9/gcc-13) it shows the improvement:

* master

  "ilogbf128": {
   "subnormal": {
    "duration": 5.09608e+08,
    "iterations": 3.3092e+07,
    "max": 28.845,
    "min": 6.824,
    "mean": 15.3997
   },
   "normal": {
    "duration": 5.05148e+08,
    "iterations": 9.1692e+07,
    "max": 7.744,
    "min": 5.377,
    "mean": 5.50918
   }
  }

* patch:

  "ilogbf128": {
   "subnormal": {
    "duration": 5.0586e+08,
    "iterations": 8.388e+07,
    "max": 7.3295,
    "min": 5.952,
    "mean": 6.03076
   },
   "normal": {
    "duration": 5.04783e+08,
    "iterations": 9.6608e+07,
    "max": 8.9255,
    "min": 5.185,
    "mean": 5.22507
   }
  }

Checked on powerpc64le-linux-gnu and powerpc64le-linux-gnu targetting
POWER8 and with --disable-multi-arch on POWER9.

3 months agomath: Remove i386 ilogb/ilogbf/llogb/llogbf
Adhemerval Zanella [Tue, 29 Apr 2025 16:30:03 +0000 (13:30 -0300)] 
math: Remove i386 ilogb/ilogbf/llogb/llogbf

The new float and double implementation does not required an
extra function call and error handling uses math_err function,
which results in better performance on i386 as well.

With gcc-14 on AMD AMD Ryzen 9 5900X, master shows:

$ ./benchtests/bench-ilogb
  "ilogb": {
   "subnormal": {
    "duration": 3.68863e+09,
    "iterations": 1.72228e+08,
    "max": 89.2995,
    "min": 21.016,
    "mean": 21.4171
   },
   "normal": {
    "duration": 3.68878e+09,
    "iterations": 1.72948e+08,
    "max": 78.6065,
    "min": 21.127,
    "mean": 21.3288
   }
  }
$ ./benchtests/bench-ilogbf
  "ilogbf": {
   "subnormal": {
    "duration": 3.68835e+09,
    "iterations": 1.66716e+08,
    "max": 46.953,
    "min": 21.793,
    "mean": 22.1236
   },
   "normal": {
    "duration": 3.68784e+09,
    "iterations": 1.66168e+08,
    "max": 46.9715,
    "min": 21.904,
    "mean": 22.1935
   }
  }

While with this patch:

$ ./benchtests/bench-ilogb
  "ilogb": {
   "subnormal": {
    "duration": 3.68134e+09,
    "iterations": 4.17516e+08,
    "max": 32.5045,
    "min": 8.3245,
    "mean": 8.81723
   },
   "normal": {
    "duration": 3.6677e+09,
    "iterations": 6.79468e+08,
    "max": 50.9305,
    "min": 5.3465,
    "mean": 5.3979
   }
}
$ ./benchtests/bench-ilogbf
  "ilogbf": {
   "subnormal": {
    "duration": 3.67553e+09,
    "iterations": 5.11032e+08,
    "max": 35.927,
    "min": 7.0485,
    "mean": 7.19237
   },
   "normal": {
    "duration": 3.66877e+09,
    "iterations": 6.556e+08,
    "max": 26.3625,
    "min": 5.5315,
    "mean": 5.59605
   }
 }

Checked on i686-linux-gnu.

3 months agomath: Optimize float ilogb/llogb
Adhemerval Zanella [Tue, 29 Apr 2025 16:30:02 +0000 (13:30 -0300)] 
math: Optimize float ilogb/llogb

It removes the wrapper by moving the error/EDOM handling to an
out-of-line implementation (__math_invalidf_i/__math_invalidf_li).
Also, __glibc_unlikely is used on errors case since it helps
code generation on recent gcc.

The code now builds to with gcc-14 on aarch64:

0000000000000000 <__ilogbf>:
   0:   1e260000        fmov    w0, s0
   4:   d3577801        ubfx    x1, x0, #23, #8
   8:   340000e1        cbz     w1, 24 <__ilogbf+0x24>
   c:   5101fc20        sub     w0, w1, #0x7f
  10:   7103fc3f        cmp     w1, #0xff
  14:   54000040        b.eq    1c <__ilogbf+0x1c>  // b.none
  18:   d65f03c0        ret
  1c:   12b00000        mov     w0, #0x7fffffff                 // #2147483647
  20:   14000000        b       0 <__math_invalidf_i>
  24:   53175800        lsl     w0, w0, #9
  28:   340000a0        cbz     w0, 3c <__ilogbf+0x3c>
  2c:   5ac01000        clz     w0, w0
  30:   12800fc1        mov     w1, #0xffffff81                 // #-127
  34:   4b000020        sub     w0, w1, w0
  38:   d65f03c0        ret
  3c:   320107e0        mov     w0, #0x80000001                 // #-2147483647
  40:   14000000        b       0 <__math_invalidf_i>

Some ABI requires additional adjustments:

  * i386 and m68k requires to use the template version, since
    both provide __ieee754_ilogb implementatations.

  * loongarch uses a custom implementation as well.

  * powerpc64le also has a custom implementation for POWER9, which
    is also used for float and float128 version.  The generic
    e_ilogb.c implementation is moved on powerpc to keep the
    current code as-is.

Checked on aarch64-linux-gnu and x86_64-linux-gnu.

3 months agomath: Remove UB and optimize double ilogbf
Adhemerval Zanella [Tue, 29 Apr 2025 16:30:01 +0000 (13:30 -0300)] 
math: Remove UB and optimize double ilogbf

The subnormal exponent calculation invokes UB by left shifting the
signed expoenent to find the first leading bit.

The patch reimplements ilogb using the math_config.h macros and
uses the new stdbit.h function to simplify the subnormal handling.

On aarch64 it generates better code:

* master:

0000000000000000 <__ieee754_ilogbf>:
   0:   1e260000        fmov    w0, s0
   4:   12007801        and     w1, w0, #0x7fffffff
   8:   72091c1f        tst     w0, #0x7f800000
   c:   54000141        b.ne    34 <__ieee754_ilogbf+0x34>  // b.any
  10:   34000201        cbz     w1, 50 <__ieee754_ilogbf+0x50>
  14:   53185c21        lsl     w1, w1, #8
  18:   12800fa0        mov     w0, #0xffffff82                 // #-126
  1c:   d503201f        nop
  20:   531f7821        lsl     w1, w1, #1
  24:   51000400        sub     w0, w0, #0x1
  28:   7100003f        cmp     w1, #0x0
  2c:   54ffffac        b.gt    20 <__ieee754_ilogbf+0x20>
  30:   d65f03c0        ret
  34:   13177c20        asr     w0, w1, #23
  38:   12b01002        mov     w2, #0x7f7fffff                 // #2139095039
  3c:   5101fc00        sub     w0, w0, #0x7f
  40:   6b02003f        cmp     w1, w2
  44:   12b00001        mov     w1, #0x7fffffff                 // #2147483647
  48:   1a819000        csel    w0, w0, w1, ls  // ls = plast
  4c:   d65f03c0        ret
  50:   320107e0        mov     w0, #0x80000001                 // #-2147483647
  54:   d65f03c0        ret

* patch:

0000000000000000 <__ieee754_ilogbf>:
   0:   1e260001        fmov    w1, s0
   4:   d3577820        ubfx    x0, x1, #23, #8
   8:   350000e0        cbnz    w0, 24 <__ieee754_ilogbf+0x24>
   c:   53175821        lsl     w1, w1, #9
  10:   34000141        cbz     w1, 38 <__ieee754_ilogbf+0x38>
  14:   5ac01021        clz     w1, w1
  18:   12800fc0        mov     w0, #0xffffff81                 // #-127
  1c:   4b010000        sub     w0, w0, w1
  20:   d65f03c0        ret
  24:   7103fc1f        cmp     w0, #0xff
  28:   5101fc00        sub     w0, w0, #0x7f
  2c:   12b00001        mov     w1, #0x7fffffff                 // #2147483647
  30:   1a811000        csel    w0, w0, w1, ne  // ne = any
  34:   d65f03c0        ret
  38:   320107e0        mov     w0, #0x80000001                 // #-2147483647
  3c:   d65f03c0        ret

Other architecture with support for stdc_leading_zeros and/or
__builtin_clzll should have similar improvements.

Checked on aarch64-linux-gnu and x86_64-linux-gnu.

3 months agomath: Optimize double ilogb/llogb
Adhemerval Zanella [Tue, 29 Apr 2025 16:30:00 +0000 (13:30 -0300)] 
math: Optimize double ilogb/llogb

It removes the wrapper by moving the error/EDOM handling to an
out-of-line implementation (__math_invalid_i/__math_invalid_li).
Also, __glibc_unlikely is used on errors case since it helps
code generation on recent gcc.

The code now builds to with gcc-14 on aarch64:

0000000000000000 <__ilogb>:
   0:   9e660000        fmov    x0, d0
   4:   d374f801        ubfx    x1, x0, #52, #11
   8:   340000e1        cbz     w1, 24 <__ilogb+0x24>
   c:   510ffc20        sub     w0, w1, #0x3ff
  10:   711ffc3f        cmp     w1, #0x7ff
  14:   54000040        b.eq    1c <__ilogb+0x1c>  // b.none
  18:   d65f03c0        ret
  1c:   12b00000        mov     w0, #0x7fffffff                 // #2147483647
  20:   14000000        b       0 <__math_invalid_i>
  24:   d374cc00        lsl     x0, x0, #12
  28:   b40000a0        cbz     x0, 3c <__ilogb+0x3c>
  2c:   dac01000        clz     x0, x0
  30:   12807fc1        mov     w1, #0xfffffc01                 // #-1023
  34:   4b000020        sub     w0, w1, w0
  38:   d65f03c0        ret
  3c:   320107e0        mov     w0, #0x80000001                 // #-2147483647
  40:   14000000        b       0 <__math_invalid_i>

Some ABI requires additional adjustments:

  * i386 and m68k requires to use the template version, since
    both provide __ieee754_ilogb implementatations.

  * loongarch uses a custom implementation as well.

  * powerpc64le also has a custom implementation for POWER9, which
    is also used for float and float128 version.  The generic
    e_ilogb.c implementation is moved on powerpc to keep the
    current code as-is.

Checked on aarch64-linux-gnu and x86_64-linux-gnu.

3 months agomath: Remove UB and optimize double ilogb
Adhemerval Zanella [Tue, 29 Apr 2025 16:29:59 +0000 (13:29 -0300)] 
math: Remove UB and optimize double ilogb

The subnormal exponent calculation invokes UB by left shifting the
signed expoenent to find the first leading bit.  The implementation
also uses 32 bits operations, which generates suboptimal code in
64 bits architectures.

The patch reimplements ilogb using the math_config.h macros and
uses the new stdbit function to simplify the subnormal handling.

On aarch64 it generates better code:

* master:

0000000000000000 <__ieee754_ilogb>:
   0:   9e660000        fmov    x0, d0
   4:   d360fc02        lsr     x2, x0, #32
   8:   d360f801        ubfx    x1, x0, #32, #31
   c:   f26c285f        tst     x2, #0x7ff00000
  10:   540001a1        b.ne    44 <__ieee754_ilogb+0x44>  // b.any
  14:   2a000022        orr     w2, w1, w0
  18:   34000322        cbz     w2, 7c <__ieee754_ilogb+0x7c>
  1c:   35000221        cbnz    w1, 60 <__ieee754_ilogb+0x60>
  20:   2a0003e1        mov     w1, w0
  24:   7100001f        cmp     w0, #0x0
  28:   12808240        mov     w0, #0xfffffbed                 // #-1043
  2c:   540000ad        b.le    40 <__ieee754_ilogb+0x40>
  30:   531f7821        lsl     w1, w1, #1
  34:   51000400        sub     w0, w0, #0x1
  38:   7100003f        cmp     w1, #0x0
  3c:   54ffffac        b.gt    30 <__ieee754_ilogb+0x30>
  40:   d65f03c0        ret
  44:   13147c20        asr     w0, w1, #20
  48:   12b00202        mov     w2, #0x7fefffff                 // #2146435071
  4c:   510ffc00        sub     w0, w0, #0x3ff
  50:   6b02003f        cmp     w1, w2
  54:   12b00001        mov     w1, #0x7fffffff                 // #2147483647
  58:   1a819000        csel    w0, w0, w1, ls  // ls = plast
  5c:   d65f03c0        ret
  60:   53155021        lsl     w1, w1, #11
  64:   12807fa0        mov     w0, #0xfffffc02                 // #-1022
  68:   531f7821        lsl     w1, w1, #1
  6c:   51000400        sub     w0, w0, #0x1
  70:   7100003f        cmp     w1, #0x0
  74:   54ffffac        b.gt    68 <__ieee754_ilogb+0x68>
  78:   d65f03c0        ret
  7c:   320107e0        mov     w0, #0x80000001                 // #-2147483647
  80:   d65f03c0        ret

* patch:

0000000000000000 <__ieee754_ilogb>:
   0:   9e660001        fmov    x1, d0
   4:   d374f820        ubfx    x0, x1, #52, #11
   8:   350000e0        cbnz    w0, 24 <__ieee754_ilogb+0x24>
   c:   d374cc21        lsl     x1, x1, #12
  10:   b4000141        cbz     x1, 38 <__ieee754_ilogb+0x38>
  14:   dac01021        clz     x1, x1
  18:   12807fc0        mov     w0, #0xfffffc01                 // #-1023
  1c:   4b010000        sub     w0, w0, w1
  20:   d65f03c0        ret
  24:   711ffc1f        cmp     w0, #0x7ff
  28:   510ffc00        sub     w0, w0, #0x3ff
  2c:   12b00001        mov     w1, #0x7fffffff                 // #2147483647
  30:   1a811000        csel    w0, w0, w1, ne  // ne = any
  34:   d65f03c0        ret
  38:   320107e0        mov     w0, #0x80000001                 // #-2147483647
  3c:   d65f03c0        ret

Other architecture with support for stdc_leading_zeros and/or
__builtin_clzll should have similar improvements.

Checked on aarch64-linux-gnu and x86_64-linux-gnu.

3 months agomath: Fix UB in expm1
Adhemerval Zanella [Fri, 18 Apr 2025 14:47:42 +0000 (11:47 -0300)] 
math: Fix UB in expm1

Building with ubsan triggers:

UBSAN: Undefined behaviour in ../sysdeps/ieee754/dbl-64/s_expm1.c:242:4 left shift of 4294967271 by 20 cannot be represented in type 'int'

Since at the time k is always positive, just cast to uint32_t.

3 months agoaarch64: Fix UB in ifunc resolvers
Adhemerval Zanella [Fri, 18 Apr 2025 13:43:36 +0000 (10:43 -0300)] 
aarch64: Fix UB in ifunc resolvers

When building with ubsan the ifunc resolvers triggers:

UBSAN: Undefined behaviour in ../sysdeps/aarch64/multiarch/memchr.c:34:1 left shift of 255 by 24 cannot be represented in type 'int'

The midr is defined as uint64_t, so use UINT64_C to define the masks
as well.

3 months agomalloc: Fix UB in malloc-debug
Adhemerval Zanella [Fri, 18 Apr 2025 13:08:21 +0000 (10:08 -0300)] 
malloc: Fix UB in malloc-debug

Multiple tests fail when malloc-debug is built with ubsan:

UBSAN: Undefined behaviour in malloc-debug.c:231:24 applying non-zero offset to a NULL pointer

The main issue is it tries to apply DUMPED_MAIN_ARENA_CHUNK or
for mem2chunk for NULL pointers.

3 months agostdio: Fix UB on snprintf
Adhemerval Zanella [Fri, 18 Apr 2025 13:03:56 +0000 (10:03 -0300)] 
stdio: Fix UB on snprintf

The elf/tst-dl-printf-static test when built with ubsan triggers:

UBSAN: Undefined behaviour in vfprintf-process-arg.c:58:36 negation of 9223372036854775808 cannot be represented in type 'long int'

3 months agox86: Fix UB in x86_cpu_present/x86_cpu_active
Adhemerval Zanella [Fri, 18 Apr 2025 12:52:04 +0000 (09:52 -0300)] 
x86: Fix UB in x86_cpu_present/x86_cpu_active

The elf/tst-cpu-features-supports (and other tests that check for
CPU features) triggers the following issue with ubsan:

UBSAN: Undefined behaviour in ../sysdeps/x86/sys/platform/x86.h:59:42 left shift of 1 by 31 cannot be represented in type 'int'

The active_array is unsigned, so use an unsigned constant as well.

3 months agox86_64: Fix UB on plt rewrite
Adhemerval Zanella [Fri, 18 Apr 2025 12:49:59 +0000 (09:49 -0300)] 
x86_64: Fix UB on plt rewrite

The elf/tst-plt-rewrite2 and elf/tst-plt-rewrite2 triggers the
failures with ubsan:

UBSAN: Undefined behaviour in ../sysdeps/x86_64/dl-machine.h:637:39 store to misaligned address 0x00007adb50230021 for type 'uint32_t'

3 months agoelf: Fix UB on _dl_early_allocate
Adhemerval Zanella [Fri, 18 Apr 2025 12:45:40 +0000 (09:45 -0300)] 
elf: Fix UB on _dl_early_allocate

The ubsan triggers on elf/tst-tls-allocation-failure-static-patched:

UBSAN: Undefined behaviour in ../sysdeps/unix/sysv/linux/dl-early_allocate.c:58:16 pointer index expression with base 0x0000555578792000 overflowed  to 0x8000555578792cc0

The function is called with a size larger than PTRDIFF_MAX, and
the addition than overflow.  Fix it by limiting the size up to
PTRDIFF_MAX, like all other malloc functions.

3 months agoelf: Fix UB on _dl_map_object_from_fd
Adhemerval Zanella [Mon, 21 Apr 2025 20:27:54 +0000 (17:27 -0300)] 
elf: Fix UB on _dl_map_object_from_fd

On 32-bit architecture ubsan triggers:

UBSAN: Undefined behaviour in dl-load.c:1345:54 pointer index expression with base 0x00612508 overflowed  to 0xf7c3a508

Use explicit uintptr_t operation instead.

3 months agoargp: Fix shift bug
Adhemerval Zanella [Thu, 17 Apr 2025 20:07:51 +0000 (17:07 -0300)] 
argp: Fix shift bug

From gnulib commits 06094e390b0 and 88033d3779362a.

3 months agolocale: Fix UB on add_locale_uint32_array
Adhemerval Zanella [Fri, 18 Apr 2025 12:29:21 +0000 (09:29 -0300)] 
locale: Fix UB on add_locale_uint32_array

The ubsan triggers:

UBSAN: Undefined behaviour in programs/locfile.c:644:3 null pointer passed as argument 2, nonnull attribute declared at unknown:0:0

The obstack_grow is only required if there is extra elements to be
inserted (n_elems > 0).

3 months agolocale: Fix UB in elem_hash
Adhemerval Zanella [Fri, 18 Apr 2025 12:40:51 +0000 (09:40 -0300)] 
locale: Fix UB in elem_hash

The ubsan triggers:

UBSAN: Undefined behaviour in ./elem-hash.h:27:14 left shift of 360447856 by 3 cannot be represented in type 'int'

Using unsigned shift here zero fill like signed.

3 months agolocalte: Fix UB on collate_finish
Adhemerval Zanella [Thu, 17 Apr 2025 21:08:01 +0000 (18:08 -0300)] 
localte: Fix UB on collate_finish

The ubsan triggers:

UBSAN: Undefined behaviour in programs/ld-collate.c:1557:7 variable length array bound evaluates to non-positive value 0

nrules is guaranteed to be at most sizeof (((struct element_t *)
0)->used_in_level) * 8, so use it instead.

3 months agolocale: Fix UB on insert_weights
Adhemerval Zanella [Fri, 18 Apr 2025 12:27:29 +0000 (09:27 -0300)] 
locale: Fix UB on insert_weights

The ubsan triggers:

UBSAN: Undefined behaviour in programs/ld-collate.c:862:5 null pointer passed as argument 2, nonnull attribute declared at unknown:0:0,

The memcpy is only requires if current 'weights' is nonnull, so
check it before calling it.

3 months agolocate: Fix UB on memcpy call
Adhemerval Zanella [Thu, 17 Apr 2025 21:03:16 +0000 (18:03 -0300)] 
locate: Fix UB on memcpy call

The ubsan triggers:

UBSAN: Undefined behaviour in programs/charmap.c:908:2 null pointer passed as argument 2, nonnull attribute declared at unknown:0:0

This is not an isseu since size is always '0' in this case.

3 months agoelf: Adjust DT_EXTRATAGIDX to avoid undefined shifts
Richard Henderson [Thu, 17 Apr 2025 20:58:35 +0000 (17:58 -0300)] 
elf: Adjust DT_EXTRATAGIDX to avoid undefined shifts

When building with --enable-ubsan, the relocation code triggers:

UBSAN: Undefined behaviour in get-dynamic-info.h:56:30 left shift of 1879047925 by 1 cannot be represented in type 'int'

Originally from
https://sourceware.org/pipermail/libc-alpha/2015-August/063015.html.

3 months agolocale: Fix --enable-ubsan build failure on some ABIs
Adhemerval Zanella [Wed, 30 Apr 2025 17:24:20 +0000 (14:24 -0300)] 
locale: Fix --enable-ubsan build failure on some ABIs

On mips, arc, powerpc, and s390 gcc 14 triggers the warning

In function ‘charmap_new_char’,
    inlined from ‘parse_charmap.isra’ at ../locale/programs/charmap.c:570:6:
../locale/programs/charmap.c:1017:32: error: ‘strncmp’ specified bound [21474836494294967295] exceeds maximum object size 2147483647 [-Werror=stringop-overread]
 1017 |   if (cp == &from[len1 - 1] || strncmp (from, to, prefix_len) != 0)
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../locale/programs/charmap.c:1017:32: error: ‘strncmp’ specified bound [21474836494294967295] exceeds maximum object size 2147483647 [-Werror=stringop-overread]
cc1: all warnings being treated as errors

So move the case to an special function and disable the sanitizer.

3 months agoriscv: Fix --enable-ubsan build failure on riscv
Adhemerval Zanella [Wed, 30 Apr 2025 17:25:28 +0000 (14:25 -0300)] 
riscv: Fix --enable-ubsan build failure on riscv

With ubsan enable, libc.so fails to build with:

[...]linkobj/libc_pic.a(setcontext.os): in function `__start_context':
[...]sysdeps/unix/sysv/linux/riscv/setcontext.S:111:(.text+0xc0): relocation
truncated to fit: R_RISCV_JAL against symbol `__GI_exit' defined in .text section
in [...]/linkobj/libc_pic.a(exit.os)

Using 'call' instead of 'j' works regardless whether UBSAN.

3 months agoubsan: Add initial support for -fsanitize=undefined
Adhemerval Zanella [Wed, 16 Apr 2025 12:32:19 +0000 (09:32 -0300)] 
ubsan: Add initial support for -fsanitize=undefined

It is enabled through a new configure flag, --enable-ubsan, and
should be used for debugging and/or testing.  Not all ubsan handlers
are implemented, only those generated/required by glibc libraries,
programs, and tests.  Some extra handlers might be needed in future
C++ tests, and __ubsan_handle_dynamic_type_cache_miss also needs a
proper implementation.

The ubsan handlers are exported from ld.so since they are used on
all libraries and tests.  This might interfere with ubsan from
compiler runtime (when programs are built with libubsan in shared
mode), and this is completely untested and/or not supported at the
moment.

There is no support for the UBSAN_OPTIONS environment variable,
although some options are supported through glibc.ubsan tunables.
Currently, glibc.ubsan.halt_on_errors can be used to avoid
the process halt when any UB handler is issued.

Using -fsanitize=undefined enables some extra compiler checks that
are not easily enabled through the libc-diag.h macro.  For instance
on iconv/iconvconfig.c, gcc 14.2.1 shows:

In file included from ../include/bits/string_fortified.h:1,
                 from ../string/string.h:548,
                 from ../include/string.h:60,
                 from iconvconfig.c:32:
In function ‘strcpy’,
    inlined from ‘write_output’ at iconvconfig.c:1033:7,
    inlined from ‘main’ at iconvconfig.c:340:14:
../string/bits/string_fortified.h:81:10: error: ‘__builtin_memcpy’ offset [0, 7] is out of the bounds [0, 0] [-Werror=array-bounds=]
   81 |   return __builtin___strcpy_chk (__dest, __src, __glibc_objsize (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../string/bits/string_fortified.h:81:10: error: ‘__builtin_memcpy’ offset [0, 7] is out of the bounds [0, 0] [-Werror=array-bounds=]
cc1: all warnings being treated as errors

Some extra code adjustments are required to fix such cases.

This preliminary support is still incomplete:

  * Not all targets are supported, nor have I checked the test suitei
    on all successful targets.  Also, I only checked with limited gcc
    versions (only gcc 14.2.1 and for some targets 15.0.0).

    Currently --enable-ubsan builds on Linux for aarch64, arm, hppa,
    i686, powerpc64, microblaze, mips64, loongarch64, sparc, s390x, and
    x86_64.

  * The instrumentation is disabled on rltd.c, although it is enabled
    on other loaders functions.

  * A lot of test cases show failures due to UB.

Also, gcc-14 triggers an ICE building math routines.  gcc-15
works correctly.

3 months agonss: remove undefined behavior and optimize getaddrinfo
Collin Funk [Mon, 5 May 2025 02:31:34 +0000 (19:31 -0700)] 
nss: remove undefined behavior and optimize getaddrinfo

On x86-64 and compiling with -O2 using stdc_leading_zeros compiles to
the bsr instruction.  The fls function removed by this patch is inlined
but still loops while checking each bit individually.

* nss/getaddrinfo.c: Include <stdbit.h>.
(fls): Remove function.  This function contains a left shift of 31 on an
'int' which is undefined.
(rfc3484_sort): Use stdc_leading_zeros instead of fls.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 months agopowerpc: Remove POWER7 strncasecmp optimization
Adhemerval Zanella [Fri, 2 May 2025 12:07:36 +0000 (09:07 -0300)] 
powerpc: Remove POWER7 strncasecmp optimization

These routines are not extensively used (gnulib documentation even
recommend use a replacement [1]), and there is already a POWER8
version that uses proper vectorized instructions.

[1] https://www.gnu.org/software/gnulib/manual/gnulib.html#C-strings

Checked with a build for some powerpc variations.
Reviewed-by: Peter Bergner <bergner@linux.ibm.com>
3 months agomanual: add more pthread functions
DJ Delorie [Sat, 3 May 2025 00:51:18 +0000 (20:51 -0400)] 
manual: add more pthread functions

Add stubs and partial docs for many undocumented pthreads functions.
While neither exhaustive nor complete, gives minimal usage docs
for many functions and expands the pthreads chapters, making it
easier to continue improving this section in the future.

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
3 months agoS390: Add new s390 platform z17.
Stefan Liebler [Tue, 29 Apr 2025 11:28:58 +0000 (13:28 +0200)] 
S390: Add new s390 platform z17.

The glibc-hwcaps subdirectories are extended by "z17".  Libraries are loaded if
the z17 facility bits are active:
- Miscellaneous-instruction-extensions facility 4
- Vector-enhancements-facility 3
- Vector-Packed-Decimal-Enhancement Facility 3
- CPU: Concurrent-Functions Facility

tst-glibc-hwcaps.c is extended in order to test z17 via new marker6.
In case of running on a z17 with a kernel not recognizing z17 yet,
AT_PLATFORM will be z900 but vector-bit in AT_HWCAP is set.  This situation
is now recognized and this testcase does not fail.

A fatal glibc error is dumped if glibc was build with architecture
level set for z17, but run on an older machine (See dl-hwcap-check.h).
Note, you might get an SIGILL before this check if you don't use:
configure --with-rtld-early-cflags=-march=<older-machine>

ld.so --list-diagnostics now also dumps information about s390.cpu_features.

Independent from z17, the s390x kernel won't introduce new HWCAP-Bits if there
is no special handling needed in kernel itself.  For z17, we don't have new
HWCAP flags, but have to check the facility bits retrieved by
stfle-instruction.

Instead of storing all the stfle-bits (currently four 64bit values) in the
cpu_features struct, we now only store those bits, which are needed within
glibc itself.  Note that we have this list twice, one with original values and
the other one which can be filtered with GLIBC_TUNABLES=glibc.cpu.hwcaps.
Those new fields are stored in so far reserved space in cpu_features struct.
Thus processes started in between the update of glibc package and we e.g. have
a new ld.so and an old libc.so, won't crash. The glibc internal ifunc-resolvers
would not select the best optimized variant.

The users of stfle-bits are also updated:
- parsing of GLIBC_TUNABLES=glibc.cpu.hwcaps
- glibc internal ifunc-resolvers
- __libc_ifunc_impl_list
- sysconf

3 months agoCorrect test descriptors in libm-test-pown.inc
Joseph Myers [Thu, 1 May 2025 22:28:59 +0000 (22:28 +0000)] 
Correct test descriptors in libm-test-pown.inc

While working on implementing compoundn, I noticed that
libm-test-pown.inc was wrongly using TEST_ff_f and AUTO_TESTS_ff_f
when the actual types involved meant fL_f should be used instead of
ff_f; fix to use the correct descriptor strings for pown.  (These
strings affect how gen-libm-test.py generates a C file in some cases.
The structure type test_fL_f_data for expected results and the use of
RUN_TEST_LOOP_fL_f in the ALL_RM_TEST call were already correct.)

Tested for x86_64.  The generated libm-test-pown.c was actually
unchanged, but the old descriptor strings were still logically
incorrect.

3 months agomalloc: Inline tcache_try_malloc
Wilco Dijkstra [Wed, 16 Apr 2025 12:21:56 +0000 (12:21 +0000)] 
malloc: Inline tcache_try_malloc

Inline tcache_try_malloc into calloc since it is the only caller.  Also fix
usize2tidx and use it in __libc_malloc, __libc_calloc and _mid_memalign.
The result is simpler, cleaner code.

Reviewed-by: DJ Delorie <dj@redhat.com>
3 months agomath: Fix UB on sinpif (BZ 32925)
Adhemerval Zanella [Fri, 25 Apr 2025 20:54:29 +0000 (17:54 -0300)] 
math: Fix UB on sinpif (BZ 32925)

The left shift overflows for 'int', use uint32_t instead.  It syncs
with CORE-MATH commit bbfabd99.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
3 months agomath: Fix UB on erfcf (BZ 32924)
Adhemerval Zanella [Fri, 25 Apr 2025 20:54:28 +0000 (17:54 -0300)] 
math: Fix UB on erfcf (BZ 32924)

The left shift overflows for 'int', use uint64_t instead.  It syncs
with CORE-MATH commit d0a2be200cbc1344d800d9ef0ebee9ad67dd3ad8.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
3 months agomath: Fix UB on cospif (BZ 32923)
Adhemerval Zanella [Fri, 25 Apr 2025 20:54:27 +0000 (17:54 -0300)] 
math: Fix UB on cospif (BZ 32923)

The left shift overflows for 'int', use uint32_t instead.  It syncs
with CORE-MATH commit bbfabd993a71b049c210b0febfd06d18369fadc1.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
3 months agomath: Fix UB on cbrtf (BZ 32922)
Adhemerval Zanella [Fri, 25 Apr 2025 20:54:26 +0000 (17:54 -0300)] 
math: Fix UB on cbrtf (BZ 32922)

The left shift overflows for 'int64_t', use unsigned instead.  It syncs
with CORE-MATH commit f7c7408d1749ec2859ea249495af699359ae559b.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
3 months agomath: Fix UB on sinhf (BZ 32921)
Adhemerval Zanella [Fri, 25 Apr 2025 20:54:25 +0000 (17:54 -0300)] 
math: Fix UB on sinhf (BZ 32921)

The left shift overflows for 'int', use uint64_t instead.  It syncs
with CORE-MATH commit bbfabd99.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
3 months agomath: Fix UB on logf (BZ 32920)
Adhemerval Zanella [Fri, 25 Apr 2025 20:54:24 +0000 (17:54 -0300)] 
math: Fix UB on logf (BZ 32920)

The left shift overflows for 'int', use a literal instead.  It syncs
with OPTIMIZED-ROUTINES commit 0f87f607b976820ef41fe64d004fe67dc7af8236.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
3 months agomath: Fix UB on coshf (BZ 32919)
Adhemerval Zanella [Fri, 25 Apr 2025 20:54:23 +0000 (17:54 -0300)] 
math: Fix UB on coshf (BZ 32919)

The left shift overflows for 'int', use uint64_t instead.  It syncs
with CORE-MATH commit 4d6192d2.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
3 months agomath: Fix UB on atanhf (BZ 32918)
Adhemerval Zanella [Fri, 25 Apr 2025 20:54:22 +0000 (17:54 -0300)] 
math: Fix UB on atanhf (BZ 32918)

The left shift overflows for 'int', use unsigned instead.  It syncs
with CORE-MATH commit 4d6192d2.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
3 months agonptl: Fix pthread_getattr_np when modules with execstack are allowed (BZ 32897)
Adhemerval Zanella [Thu, 24 Apr 2025 15:27:44 +0000 (12:27 -0300)] 
nptl: Fix pthread_getattr_np when modules with execstack are allowed (BZ 32897)

The BZ 32653 fix (12a497c716f0a06be5946cabb8c3ec22a079771e) kept the
stack pointer zeroing from make_main_stack_executable on
_dl_make_stack_executable.  However, previously the 'stack_endp'
pointed to temporary variable created before the call of
_dl_map_object_from_fd; while now we use the __libc_stack_end
directly.

Since pthread_getattr_np relies on correct __libc_stack_end, if
_dl_make_stack_executable is called (for instance, when
glibc.rtld.execstack=2 is set) __libc_stack_end will be set to zero,
and the call will always fail.

The __libc_stack_end zero was used a mitigation hardening, but since
52a01100ad011293197637e42b5be1a479a2f4ae it is used solely on
pthread_getattr_np code.  So there is no point in zeroing anymore.

Checked on x86_64-linux-gnu and i686-linux-gnu.
Reviewed-by: Sam James <sam@gentoo.org>
3 months agoRISC-V: Use builtin for ffs and ffsll while supported extension available
Julian Zhu [Fri, 8 Nov 2024 13:41:43 +0000 (21:41 +0800)] 
RISC-V: Use builtin for ffs and ffsll while supported extension available

Hardware ctz instructions are available in the RISC-V Zbb and XTheadBb extension. With special `-march` flags defined, we can generate more simplified code compared to the generic implementation of `ffs`/`ffsll`.

Signed-off-by: Julian Zhu <julian.oerv@isrc.iscas.ac.cn>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 months agostdio: Remove UB on printf_fp
Adhemerval Zanella [Fri, 25 Apr 2025 21:06:33 +0000 (18:06 -0300)] 
stdio: Remove UB on printf_fp

The __printf_fp_buffer_1 issues count_leading_zeros with 0 argument,
which might leads to call __builtin_ctz depending of the ABI.
Replace with stdbit.h function instead.

Checked on x86_64-linux-gnu and i686-linux-gnu.
Reviewed-by: Paul Eggert <eggert@cs.ucla.edu>
3 months agobenchtest: Correct shell script related to bench-malloc-thread
Cupertino Miranda [Fri, 25 Apr 2025 14:38:25 +0000 (16:38 +0200)] 
benchtest: Correct shell script related to bench-malloc-thread

This patch changes the shell script that selects which arguments are used
for the execution of bench-malloc-thread.
The problem seems to have been introduced in commit:

  commit 2d6427a63cad8056ba6bcaaaa8df21977c8dde3d
  Author: Wangyang Guo <wangyang.guo@intel.com>
  Date:   Fri Nov 29 16:05:35 2024 +0800
  benchtests: Add calloc test

With current condition, the following error "/bin/sh: 3: [[: not found"
occurs when executing `make bench BENCHSET="malloc-thread"` and the else
path is taken, using incorrect arguments for bench test execution.

Error is reproducible in Debian based distros.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 months agolinux/termio: remove <termio.h> and struct termio
H. Peter Anvin [Fri, 25 Apr 2025 05:30:59 +0000 (07:30 +0200)] 
linux/termio: remove <termio.h> and struct termio

The <termio.h> interface is absolutely ancient: it was obsoleted by
<termios.h> already in the first version of POSIX (1988) and thus
predates the very first version of Linux. Unfortunately, some constant
macros are used both by <termio.h> and <termios.h>; particularly
problematic is the baud rate constants since the termio interface
*requires* that the baud rate is set via an enumeration as part of
c_cflag.

In preparation of revamping the termios interface to support the
arbitrary baud rate capability that the Linux kernel has supported
since 2008, remove <termio.h> in the hope that no one still uses this
archaic interface.

Note that there is no actual code in glibc to support termio: it is
purely an unabstracted ioctl() interface.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 months agoelf: tst-audit10: split AVX512F code into dedicated functions [BZ #32882]
Aurelien Jarno [Sat, 19 Apr 2025 18:45:07 +0000 (20:45 +0200)] 
elf: tst-audit10: split AVX512F code into dedicated functions [BZ #32882]

"Recent" GCC versions (since commit fc62716fe8d1, backported to stable
branches) emit a vzeroupper instruction at the end of functions
containing AVX instructions. This causes the tst-audit10 test to fail
on CPUs lacking AVX instructions, despite the AVX512F check. The crash
occurs in the pltenter function of tst-auditmod10b.c.

Fix that by moving the code guarded by the check_avx512 function into
specific functions using the target ("avx512f") attribute. Note that
since commit 5359c3bc91cc ("x86-64: Remove compiler -mavx512f check") it
is safe to assume that the compiler has AVX512F support, thus the
__AVX512F__ checks can be dropped.

Tested on non-AVX, AVX2 and AVX512F machines.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 months agoAdd NT_ARM_GCS and NT_RISCV_TAGGED_ADDR_CTRL from Linux 6.13 to elf.h
Joseph Myers [Tue, 22 Apr 2025 17:02:23 +0000 (17:02 +0000)] 
Add NT_ARM_GCS and NT_RISCV_TAGGED_ADDR_CTRL from Linux 6.13 to elf.h

Linux 6.13 adds new ELF note types NT_ARM_GCS and
NT_RISCV_TAGGED_ADDR_CTRL.  Add these to glibc's elf.h.

Tested for x86_64.

3 months agoAdd AT_* constants from Linux 6.12
Joseph Myers [Tue, 22 Apr 2025 17:00:34 +0000 (17:00 +0000)] 
Add AT_* constants from Linux 6.12

Linux 6.12 adds AT_RENAME_* aliases for RENAME_* flags for renameat2,
and also AT_HANDLE_MNT_ID_UNIQUE.  Add the first set of aliases to
stdio.h alongside the RENAME_* names, and AT_HANDLE_MNT_ID_UNIQUE to
bits/fcntl-linux.h.

Tested for x86_64.

3 months agohurd: Make symlink return EEXIST on existing target directory
Samuel Thibault [Mon, 21 Apr 2025 20:21:17 +0000 (22:21 +0200)] 
hurd: Make symlink return EEXIST on existing target directory

8ef17919509e ("hurd: Fix EINVAL error on linking to a slash-trailing path
[BZ #32569]) made symlink return ENOTDIR, but the gnulib testsuite does
not recognize it for such a situation, and EEXIST is indeed more
comprehensible to users.

3 months agohurd: Clear FP exceptions before calling signal handler
Samuel Thibault [Mon, 21 Apr 2025 17:58:04 +0000 (19:58 +0200)] 
hurd: Clear FP exceptions before calling signal handler

This avoids SIGFPE handlers (or code longjmp-ed to) getting disturbed by the
exception that generated it.

Note: gcc's unwinding depends on the rpc_wait_trampoline/trampoline exact
code, so we here avoid breaking it.

3 months agohurd: Do not check for xstate level if it was not initialized
Samuel Thibault [Mon, 21 Apr 2025 17:45:02 +0000 (19:45 +0200)] 
hurd: Do not check for xstate level if it was not initialized

If __thread_get_state failed, there is no xstate level to check.
ok is 0 already and the memory exists, but better not read uninitialized
memory.

3 months agohurd: Do not restore xstate when it is not initialized
Samuel Thibault [Mon, 21 Apr 2025 17:42:27 +0000 (19:42 +0200)] 
hurd: Do not restore xstate when it is not initialized

If the process has never used fp before getting a signal, xstate is set
(and thus the x87 state is not initialized) but xstate->initialized is still
0, and we should not restore anything.

3 months agohurd: Make *utime*s catch invalid times [BZ #32802, BZ #32803]
Samuel Thibault [Tue, 18 Mar 2025 17:49:21 +0000 (18:49 +0100)] 
hurd: Make *utime*s catch invalid times [BZ #32802, BZ #32803]

3 months agohurd: save xstate during signal handling
Luca Dariz [Wed, 19 Mar 2025 17:11:18 +0000 (18:11 +0100)] 
hurd: save xstate during signal handling

* hurd/Makefile: add new tests
* hurd/test-sig-rpc-interrupted.c: check xstate save and restore in
  the case where a signal is delivered to a thread which is waiting
  for an rpc. This test implements the rpc interruption protocol used
  by the hurd servers. It was so far passing on Debian thanks to the
  local-intr-msg-clobber.diff patch, which is now obsolete.
* hurd/test-sig-xstate.c: check xstate save and restore in the case
  where a signal is delivered to a running thread, making sure that
  the xstate is modified in the signal handler.
* hurd/test-xstate.h: add helpers to test xstate
* sysdeps/mach/hurd/i386/bits/sigcontext.h: add xstate to the
  sigcontext structure.
+ sysdeps/mach/hurd/i386/sigreturn.c: restore xstate from the saved
  context
* sysdeps/mach/hurd/x86/trampoline.c: save xstate if
  supported. Otherwise we fall back to the previous behaviour of
  ignoring xstate.
* sysdeps/mach/hurd/x86_64/bits/sigcontext.h: add xstate to the
  sigcontext structure.
* sysdeps/mach/hurd/x86_64/sigreturn.c: restore xstate from the saved
  context

Signed-off-by: Luca Dariz <luca@orpolo.org>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-ID: <20250319171118.142163-1-luca@orpolo.org>

3 months agohurd: Check return value of mach_port_mod_refs() in the dup routine of fcntl()
Zhaoming Luo [Mon, 10 Mar 2025 08:44:09 +0000 (16:44 +0800)] 
hurd: Check return value of mach_port_mod_refs() in the dup routine of fcntl()

Message-ID: <20250310084409.24177-1-zhmingluo@163.com>

3 months agomalloc: move tcache_init out of hot tcache paths
Cupertino Miranda [Wed, 16 Apr 2025 11:22:53 +0000 (11:22 +0000)] 
malloc: move tcache_init out of hot tcache paths

This patch moves any calls of tcache_init away after tcache hot paths.
Since there is no reason to initialize tcaches in the hot path and since
we need to be able to check tcache != NULL in any case, because of
tcache_thread_shutdown function, moving tcache_init away from hot path
can only be beneficial.
The patch also removes the initialization of tcaches within the
__libc_free call. It only makes sense to initialize tcaches for the
thread after it calls one of the allocation functions. Also the patch
removes the save/restore of errno from tcache_init code, as it is no
longer needed.

3 months agoaarch64: Add back non-temporal load/stores from oryon-1's memset
Andrew Pinski [Fri, 21 Feb 2025 23:13:53 +0000 (15:13 -0800)] 
aarch64: Add back non-temporal load/stores from oryon-1's memset

I misunderstood the recommendation from the hardware team about non-temporal
load/stores. It is still recommended to use them in memset for large sizes. It
was not recommended for their use with device memory and memset is already
not valid to be used with device memory.

This reverts commit e6590f0c86632c36c9a784cf96075f4be2e920d2.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 months agoaarch64: Add back non-temporal load/stores from oryon-1's memcpy
Andrew Pinski [Fri, 21 Feb 2025 23:10:18 +0000 (15:10 -0800)] 
aarch64: Add back non-temporal load/stores from oryon-1's memcpy

I misunderstood the recommendation from the hardware team about non-temporal
load/stores. It is still recommended to use them in memcpy for large sizes. It
was not recommended for their use with device memory and memcpy is already
not valid to be use with device memory.

This reverts commit eb5eeb47403e0a91de834868e501b4d62b8d2cb9.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 months agomalloc: Use tailcalls in __libc_free
Wilco Dijkstra [Mon, 31 Mar 2025 12:19:06 +0000 (12:19 +0000)] 
malloc: Use tailcalls in __libc_free

Use tailcalls to avoid the overhead of a frame on the free fastpath.
Move tcache initialization to _int_free_chunk().  Add malloc_printerr_tail()
which can be tailcalled without forcing a frame like no-return functions.
Change tcache_double_free_verify() to retry via __libc_free() after clearing
the key.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
3 months agomalloc: Inline tcache_free
Wilco Dijkstra [Mon, 31 Mar 2025 11:51:44 +0000 (11:51 +0000)] 
malloc: Inline tcache_free

Inline tcache_free since it's only used by __libc_free.  Add __glibc_likely
for the tcache checks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
3 months agomalloc: Improve free checks
Wilco Dijkstra [Mon, 31 Mar 2025 11:44:02 +0000 (11:44 +0000)] 
malloc: Improve free checks

The checks on size can be merged and use __builtin_add_overflow.  Since
tcache only handles small sizes (and rejects sizes < MINSIZE), delay this
check until after tcache.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
3 months agomalloc: Inline _int_free_check
Wilco Dijkstra [Mon, 31 Mar 2025 11:28:14 +0000 (11:28 +0000)] 
malloc: Inline _int_free_check

Inline _int_free_check since it is only used by __libc_free.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
3 months agomalloc: Inline _int_free
Wilco Dijkstra [Mon, 31 Mar 2025 11:24:58 +0000 (11:24 +0000)] 
malloc: Inline _int_free

Inline _int_free since it is a small function and only really used by
__libc_free.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
3 months agomalloc: Move mmap code out of __libc_free hotpath
Wilco Dijkstra [Mon, 24 Mar 2025 18:23:37 +0000 (18:23 +0000)] 
malloc: Move mmap code out of __libc_free hotpath

Currently __libc_free checks for a freed mmap chunk in the fast path.
Also errno is always saved and restored to preserve it.  Since mmap chunks
are larger than the largest tcache chunk, it is safe to delay this and
handle tcache, smallbin and medium bin blocks first.  Move saving of errno
to cases that actually need it.  Remove a safety check that fails on mmap
chunks and a check that mmap chunks cannot be added to tcache.

Performance of bench-malloc-thread improves by 9.2% for 1 thread and
6.9% for 32 threads on Neoverse V2.

Reviewed-by: DJ Delorie <dj@redhat.com>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
3 months agomanual/tunables: fix a trivial typo
Aurelien Jarno [Sun, 13 Apr 2025 15:33:23 +0000 (17:33 +0200)] 
manual/tunables: fix a trivial typo

Fixes: 12a497c716f0 ("elf: Extend glibc.rtld.execstack tunable to force executable stack (BZ 32653)"
Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 months agoFix spelling mistake "trucate" -> "truncate"
Colin Ian King [Mon, 14 Apr 2025 13:12:50 +0000 (10:12 -0300)] 
Fix spelling mistake "trucate" -> "truncate"

There is a spelling mistake in a test filename. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 months agoFix spelling mistake "suports" -> "supports"
Colin Ian King [Mon, 14 Apr 2025 13:11:52 +0000 (10:11 -0300)] 
Fix spelling mistake "suports" -> "supports"

There are spelling mistakes in assert messages. Fix them.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 months agoFix spelling mistake "succsefully" -> "successfully"
Colin Ian King [Mon, 14 Apr 2025 13:11:02 +0000 (10:11 -0300)] 
Fix spelling mistake "succsefully" -> "successfully"

There is a spelling mistake in a puts statement. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 months agomanual: Mention POSIX-1.2024 requires time_t to be 64 bit or wider.
Collin Funk [Thu, 3 Apr 2025 00:41:58 +0000 (17:41 -0700)] 
manual: Mention POSIX-1.2024 requires time_t to be 64 bit or wider.

* manual/time.texi (Time Types): Mention POSIX-1.2024 requires 64 bit
time_t.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 months agomanual: Update standardization of getline and getdelim [BZ #32830]
Collin Funk [Tue, 1 Apr 2025 05:54:30 +0000 (22:54 -0700)] 
manual: Update standardization of getline and getdelim [BZ #32830]

* manual/stdio.texi (Line Input): Document that getline and getdelim
where GNU extensions until standardized in POSIX.1-2008.  Add restrict
to function prototypes.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 months agolibio: Add test case for fflush
Frédéric Bérat [Mon, 9 Sep 2024 12:43:36 +0000 (14:43 +0200)] 
libio: Add test case for fflush

Since one path uses _IO_SYNC and the other _IO_OVERFLOW, the newly added
test cases verifies that `fflush (FILE)` and `fflush (NULL)` are
semantically equivalent from the FILE perspective.

Reviewed-by: Joseph Myers <josmyers@redhat.com>
3 months agolibio: Synthesize ESPIPE error if lseek returns 0 after reading bytes
Florian Weimer [Tue, 8 Apr 2025 16:38:38 +0000 (18:38 +0200)] 
libio: Synthesize ESPIPE error if lseek returns 0 after reading bytes

This is required so that fclose, when trying to seek to the right
position after filling the input buffer, does not fail with EINVAL.
This fclose code path only ignores ESPIPE errors.

Reported by Petr Pisar on
<https://bugzilla.redhat.com/show_bug.cgi?id=2358265>.

Fixes commit be6818be31e756398e45f70e2819d78be0961223 ("Make fclose
seek input file to right offset (bug 12724)").

Reviewed-by: Frédéric Bérat <fberat@redhat.com>
3 months agox86: Detect Intel Diamond Rapids
H.J. Lu [Sat, 12 Apr 2025 15:37:29 +0000 (08:37 -0700)] 
x86: Detect Intel Diamond Rapids

Detect Intel Diamond Rapids and tune it similar to Intel Granite Rapids.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
3 months agox86: Handle unknown Intel processor with default tuning
Sunil K Pandey [Fri, 11 Apr 2025 15:52:52 +0000 (08:52 -0700)] 
x86: Handle unknown Intel processor with default tuning

Enable default tuning for unknown Intel processor.

Tested on x86, no regression.

Co-Authored-By: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 months agoconform: Add initial support for C23.
Collin Funk [Sat, 5 Apr 2025 03:48:25 +0000 (20:48 -0700)] 
conform: Add initial support for C23.

Hi Joseph,

As we discussed, this patch just makes C23 include every check that is
performed by C11.

I tested the commit by adding the ISO23 Make and Python variables to be
the same as ISO11.  So the only difference was compiling with -DISO23
instead of -DISO11.  And changed the temporary directories to instead
use the format f'/tmp/glibc-{self.standard}-{self.header}'.  Then I used
a shell script to run 'cmp' on each file in the ISO11 and ISO23
directories for each header to make sure they were the same.

-- 8< --

Make C23 checks include every test that is performed by C11.  Done by
running the following command:

find conform -name '*.h-data' | xargs sed -i \
  -e 's| !defined ISO11| !defined ISO11 \&\& !defined ISO23|g' \
  -e 's| defined ISO11| defined ISO11 \|\| defined ISO23|g' \
  -e 's|ifdef ISO11|if defined ISO11 \|\| defined ISO23|g' \
  -e 's|ifndef ISO11|if !defined ISO11 \&\& !defined ISO23|g'

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
3 months agox86: Add ARL/PTL/CWF model detection support
Sunil K Pandey [Fri, 4 Apr 2025 01:14:20 +0000 (18:14 -0700)] 
x86: Add ARL/PTL/CWF model detection support

- Add ARROWLAKE model detection.
- Add PANTHERLAKE model detection.
- Add CLEARWATERFOREST model detection.

Intel® Architecture Instruction Set Extensions Programming Reference
https://cdrdv2.intel.com/v1/dl/getContent/671368 Section 1.2.

No regression, validated model detection on SDE.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 months agotimezone: Enhance tst-bz28707 diagnostics
Florian Weimer [Thu, 10 Apr 2025 08:08:30 +0000 (10:08 +0200)] 
timezone: Enhance tst-bz28707 diagnostics

This hopefully provides additional information about why the
test failed, in case the fix in commit 62db87ab24f9ca483f97f
("timezone: Fix tst-bz28707 Makefile rule") turns out to be
insufficient.

Reviewed-by: Paul Eggert <eggert@cs.ucla.edu>
3 months agopowerpc: Remove relocation cache flush code for power64
Florian Weimer [Thu, 10 Apr 2025 04:52:18 +0000 (06:52 +0200)] 
powerpc: Remove relocation cache flush code for power64

This is only needed for -mno-secure-plt, and this linkage mode
is not supported with powerpc64 and powerp64le.

Reviewed-by: Peter Bergner <bergner@linux.ibm.com>
3 months agomath: Fix up THREEp96 constant in expf128 [BZ #32411]
Jakub Jelinek [Wed, 9 Apr 2025 16:24:11 +0000 (18:24 +0200)] 
math: Fix up THREEp96 constant in expf128 [BZ #32411]

As mentioned by the reporter in a pull request against gcc-mirror,
the THREEp96 constant in e_expl.c is incorrect, it is actually 0x3.p+94f128
rather than 0x3.p+96f128.

The algorithm uses that to compute the t2 integer (tval2), by whose
delta it adjusts the x+xl pair and then in the result uses the precomputed
exp value for that entry.
Using 0x3.p+94f128 rather than 0x3.p+96f128 results in tval2 sometimes
being one smaller, sometimes one larger than the desired value, thus can mean
the x+xl pair after adjustment will be larger in absolute value than it
should be.

DesWursters created a test program for this
https://github.com/DesWurstes/comparefloats
and his results were
total: 1135000000 not_equal: 4322 earlier_score: 674 later_score: 3648
I've modified this so with
https://sourceware.org/bugzilla/show_bug.cgi?id=32411#c3
so that it actually tests pseudo-random _Float128 values with range
(-16384.,16384) with strong bias on values larger than 0.0002 in absolute
value (so that tval1/tval2 aren't zero most of the time) and that gave
total: 10000000000 not_equal: 29861 earlier_score: 4606 later_score: 25255
So, in both cases, in most cases the change doesn't result in any differences,
and in those rare cases where does, about 85% have smaller ulp than without
the patch.
Additionally I've tried
https://sourceware.org/bugzilla/show_bug.cgi?id=32411#c4
and in 2 billion iterations it didn't find any case where x+xl after the
adjustments without this change would be smaller in absolute value compared
to x+xl after the adjustments with this change.

Reviewed-by: Joseph Myers <josmyers@redhat.com>
3 months agoelf: Extend glibc.rtld.execstack tunable to force executable stack (BZ 32653)
Adhemerval Zanella [Thu, 13 Feb 2025 17:02:38 +0000 (14:02 -0300)] 
elf: Extend glibc.rtld.execstack tunable to force executable stack (BZ 32653)

From the bug report [1], multiple programs still require to dlopen
shared libraries with either missing PT_GNU_STACK or with the executable
bit set.  Although, in some cases, it seems to be a hard-craft assembly
source without the required .note.GNU-stack marking (so the static linker
is forced to set the stack executable if the ABI requires it), other
cases seem that the library uses trampolines [2].

Unfortunately, READ_IMPLIES_EXEC is not an option since on some ABIs
(x86_64), the kernel clears the bit, making it unsupported.  To avoid
reinstating the broken code that changes stack permission on dlopen
(0ca8785a28), this patch extends the glibc.rtld.execstack tunable to
allow an option to force an executable stack at the program startup.

The tunable is a security issue because it defeats the PT_GNU_STACK
hardening.  It has the slight advantage of making it explicit by the
caller, and, as for other tunables, this is disabled for setuid binaries.
A tunable also allows us to eventually remove it, but from previous
experiences, it would require some time.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=32653
[2] https://github.com/conda-forge/ctng-compiler-activation-feedstock/issues/143
Reviewed-by: Sam James <sam@gentoo.org>
3 months agostdlib: Implement C2Y uabs, ulabs, ullabs and uimaxabs
Lenard Mollenkopf [Tue, 8 Apr 2025 12:16:54 +0000 (14:16 +0200)] 
stdlib: Implement C2Y uabs, ulabs, ullabs and uimaxabs

C2Y adds unsigned versions of the abs functions (see C2Y draft N3467 and
proposal N3349).

Tested for x86_64.

Signed-off-by: Lenard Mollenkopf <glibc@lenardmollenkopf.de>
3 months agostdio-common: In tst-setvbuf2, close helper thread descriptor only if opened
Florian Weimer [Tue, 8 Apr 2025 08:39:44 +0000 (10:39 +0200)] 
stdio-common: In tst-setvbuf2, close helper thread descriptor only if opened

The helper thread may get canceled before the open system
call succeds.  Then ThreadData.fd remains zero, and eventually
the xclose call in end_reader_thread fails because descriptor 0
is not open.

Instead, initialize the fd member to -1 (not a valid descriptor)
and close the descriptor only if valid.  Do this in a new end_thread
helper routine.

Also add more error checking to close operations.

Fixes commit 95b780c1d0549678c0a244c6e2112ec97edf0839 ("stdio: Add
more setvbuf tests").

4 months agoRemove duplicates from binaries-shared-tests when creating make rules
Andreas Schwab [Mon, 7 Apr 2025 08:41:38 +0000 (10:41 +0200)] 
Remove duplicates from binaries-shared-tests when creating make rules

This avoids a warning from make because binaries-shared-tests contains
both $(tests-container) and $(tests-internal).

4 months agox86: Optimize xstate size calculation
Sunil K Pandey [Thu, 3 Apr 2025 20:00:45 +0000 (13:00 -0700)] 
x86: Optimize xstate size calculation

Scan xstate IDs up to the maximum supported xstate ID.  Remove the
separate AMX xstate calculation.  Instead, exclude the AMX space from
the start of TILECFG to the end of TILEDATA in xsave_state_size.

Completed validation on SKL/SKX/SPR/SDE and compared xsave state size
with "ld.so --list-diagnostics" option, no regression.

Co-Authored-By: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
4 months agoNEWS: update for GCC 12.1 requirement [BZ #32539]
Sam James [Wed, 2 Apr 2025 17:49:42 +0000 (18:49 +0100)] 
NEWS: update for GCC 12.1 requirement [BZ #32539]

Since 27b96e069aad17cefea9437542180bff448ac3a0, the minimum GCC required
to build glibc is GCC 12.1.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
4 months agostdio: fix hurd link for tst-setvbuf2
DJ Delorie [Wed, 2 Apr 2025 18:54:03 +0000 (14:54 -0400)] 
stdio: fix hurd link for tst-setvbuf2

4 months agostdlib: Fix qsort memory leak if callback throws (BZ 32058)
Adhemerval Zanella [Thu, 27 Mar 2025 15:30:48 +0000 (12:30 -0300)] 
stdlib: Fix qsort memory leak if callback throws (BZ 32058)

If the input buffer exceeds the stack auxiliary buffer, qsort will
malloc a temporary one to call mergesort.  Since C++ standard does
allow the callback comparison function to throw [1], the glibc
implementation can potentially leak memory.

The fixes uses a pthread_cleanup_combined_push and
pthread_cleanup_combined_pop, so it can work with and without
exception enables.  The qsort code path that calls malloc now
requires some extra setup and a call to __pthread_cleanup_push
anmd __pthread_cleanup_pop (which should be ok since they just
setup some buffer state).

Checked on x86_64-linux-gnu.

[1] https://timsong-cpp.github.io/cppwp/n4950/alg.c.library#4

Reviewed-by: DJ Delorie <dj@redhat.com>
4 months agosysdeps: powerpc: restore -mlong-double-128 check
Sam James [Tue, 1 Apr 2025 20:56:52 +0000 (21:56 +0100)] 
sysdeps: powerpc: restore -mlong-double-128 check

We mistakenly dropped the check in 27b96e069aad17cefea9437542180bff448ac3a0;
there's some other checks which we *can* drop, but let's worry about that
later.

Fixes the build on ppc64le where GCC is configured with --with-long-double-format=ieee.

Reviewed-by: Andreas Schwab <schwab@suse.de>
4 months agostdio: Add more setvbuf tests
DJ Delorie [Fri, 14 Mar 2025 20:08:35 +0000 (16:08 -0400)] 
stdio: Add more setvbuf tests

4 months agoadd ptmx support to test-container
DJ Delorie [Fri, 14 Mar 2025 20:08:12 +0000 (16:08 -0400)] 
add ptmx support to test-container

4 months agoUpdate syscall lists for Linux 6.14
Joseph Myers [Tue, 1 Apr 2025 12:44:26 +0000 (12:44 +0000)] 
Update syscall lists for Linux 6.14

Linux 6.14 has no new syscalls.  Update the version number in
syscall-names.list to reflect that it is still current for 6.14.

Tested with build-many-glibcs.py.

4 months agox86: Link tst-gnu2-tls2-x86-noxsave{,c,xsavec} with libpthread
Florian Weimer [Mon, 31 Mar 2025 19:33:18 +0000 (21:33 +0200)] 
x86: Link tst-gnu2-tls2-x86-noxsave{,c,xsavec} with libpthread

This fixes a test build failure on Hurd.

Fixes commit 145097dff170507fe73190e8e41194f5b5f7e6bf ("x86: Use separate
variable for TLSDESC XSAVE/XSAVEC state size (bug 32810)").

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agoelf: Fix tst-origin build when toolchain defaults to --as-needed (BZ 32823)
John David Anglin [Mon, 31 Mar 2025 16:48:32 +0000 (13:48 -0300)] 
elf: Fix tst-origin build when toolchain defaults to --as-needed (BZ 32823)

Checked on aarch64-linux-gnu.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 months agoRaise the minimum GCC version to 12.1 [BZ #32539]
H.J. Lu [Wed, 12 Feb 2025 04:53:09 +0000 (12:53 +0800)] 
Raise the minimum GCC version to 12.1 [BZ #32539]

For all Linux distros with glibc 2.40 which I can find, GCC 14.2 is used
to compile glibc 2.40:

OS                    GCC      URL
AOSC                  14.2.0   https://aosc.io/
Arch Linux            14.2.0   https://archlinux.org/
ArchPOWER             14.2.0   https://archlinuxpower.org/
Artix                 14.2.0   https://artixlinux.org/
Debian                14.2.0   https://www.debian.org/
Devuan                14.2.0   https://www.devuan.org/
Exherbo               14.2.0   https://www.exherbolinux.org/
Fedora                14.2.1   https://fedoraproject.org/
Gentoo                14.2.1   https://gentoo.org/
Kali Linux            14.2.0   https://www.kali.org/
KaOS                  14.2.0   https://kaosx.us/
LiGurOS               14.2.0   https://liguros.gitlab.io/
Mageia                14.2.0   https://www.mageia.org/en/
Manjaro               14.2.0   https://manjaro.org/
NixOS                 14.2.0   https://nixos.org/
openmamba             14.2.0   https://openmamba.org/
OpenMandriva          14.2.0   https://openmandriva.org/
openSUSE              14.2.0   https://www.opensuse.org/
Parabola              14.2.0   https://www.parabola.nu/
PLD Linux             14.2.0   https://pld-linux.org/
PureOS                14.2.0   https://pureos.net/
Raspbian              14.2.0   http://raspbian.org/
Slackware             14.2.0   http://www.slackware.com/
Solus                 14.2.0   https://getsol.us/
T2 SDE                14.2.0   http://t2sde.org/
Ubuntu                14.2.0   https://www.ubuntu.com/
Wikidata              14.2.0   https://wikidata.org/

Support older versions of GCC to build glibc 2.42:

1. Need to work around bugs in older versions of GCC.
2. Can't use the new features in newer versions of GCC, which may be
required for new features, like _Float16 which requires GCC 12.1 or
above, in glibc,

The main benefit of supporting older versions of GCC is easier backport
of bug fixes to the older releases of glibc, which can be mitigated by
avoiding incompatible features in newer versions of GCC for critical bug
fixes.  Require GCC 12.1 or newer to build.  Remove GCC version check for
PowerPC and s390x.

TEST_CC and TEST_CXX can be used to test the glibc build with the older
versions of GCC.

For glibc developers who are using Linux OSes which don't come with GCC
12.1 or newer, they should build and install GCC 12.1 or newer to work
on glibc.

This fixes BZ #32539.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
4 months agoFix typo in comment
YLK [Mon, 24 Mar 2025 14:04:21 +0000 (22:04 +0800)] 
Fix typo in comment