Glibc 2.31 System Library Release

After six months of development published system library release GNU C Library (glibc) 2.31, which fully complies with the requirements of ISO C11 and POSIX.1-2008. The new release includes fixes from 58 developers.

Implemented in Glibc 2.31 improvements you can note:

  • Added macro _ISOC2X_SOURCE to enable features defined in draft version of future ISO standard C2X. These features are also enabled when using the _GNU_SOURCE macro or when building with gcc with the "-std=gnu2x" flag;
  • For functions defined in the header file "math.h" that round their results to a smaller type, the corresponding generic type macros are proposed in the file "tgmath.h", as required by the TS 18661-1:2014 and TS 18661-3 specifications: 2015;
  • Added the pthread_clockjoin_np() function, which waits for the thread to terminate, taking into account the timeout (if the timeout occurs before completion, the function will return an error). Unlike pthread_timedjoin_np(), in pthread_clockjoin_np() it is allowed to define the timer type for timeout calculation - CLOCK_MONOTONIC (takes into account the time spent by the system in sleep mode) or CLOCK_REALTIME;
  • Support for the trust-ad option in /etc/resolv.conf and the RES_TRUSTAD flag in _res.options has been added to the DNS resolver, which, when set, sends the DNSSEC flag in DNS queries AD (authenticated data). In this mode, the AD flag set by the server is made available to applications that call functions like res_search(). By default, if the suggested options are not set, glibc does not specify the AD flag in requests and automatically clears it in responses, indicating no DNSSEC checking;
  • Linux kernel header files are no longer required to build working system call wrappers for Glibc. The exception is the 64-bit RISC-V architecture;
  • Eliminated vulnerability CVE-2019-19126, which allows you to bypass protection
    ASLR in programs with the setuid flag and determine the mapping of addresses in loaded libraries by manipulating the environment variable LD_PREFER_MAP_32BIT_EXEC.

Changes that break compatibility:

  • totalorder() , totalordermag() , and similar functions for other floating point types now take pointers as arguments to avoid warnings about value conversions in state NaN, in accordance with the recommendations of TS 18661-1 proposed for the future C2X standard.
    Existing executables that pass floating-point arguments directly will continue to run unchanged;

  • The long-deprecated stime function is no longer available for glibc-linked binaries, and its definition has been removed from time.h. To set the system time, use the clock_settime function. In the future, it is planned to remove the deprecated ftime function, as well as the sys/timeb.h header file (gettimeofday or clock_gettime should be used instead of ftime);
  • The gettimeofday function no longer provides information about the system-wide timezone (this feature was current in the 4.2-BSD era and has been deprecated for many years). You should now pass a null pointer in the 'tzp' argument, and use the localtime() function to get information about the time zone in relation to the current time. Calling gettimeofday with a non-null 'tzp' argument will return the empty tz_minuteswest and tz_dsttime fields in the timezone structure. The gettimeofday function itself is deprecated in POSIX (recommended to use clock_gettime instead of gettimeofday), but there are no plans to remove it from glibc;
  • Settimeofday has deprecated support for passing parameters to set the time and the time-adjusting offset at the same time. When calling settimeofday, one of the arguments (time or offset) must now be set to null, otherwise the function call will fail with an EINVAL error. Like gettimeofday, the settimeofday function is deprecated by POSIX and it is recommended to use the clock_settime function or the adjtime family of functions instead;
  • Removed support for the SPARC ISA v7 architecture (v8 support is retained for now, but only for CAS-enabled processors such as LEON processors, not SuperSPARC processors).
  • If pairing fails in "lazyβ€œin which the linker does not look up function symbols until the first call to that function, the dlopen function now forcibly terminates the process (previously returned NULL on failure);
  • The MIPS hard-float ABI now uses the executable stack unless the build explicitly restricts the use of the Linux 4.8+ kernel via the "--enable-kernel=4.8.0" parameter (with kernels prior to 4.8, crashes are observed for some MIPS configurations);
  • Time manipulation syscall bindings have been moved to use the time64 syscall, if available (on 32-bit systems, glibc first attempts to use the new 64-bit time type-manipulating system calls, and if there are none, it falls back to the old ones. 32-bit calls).

Source: opennet.ru

Add a comment