From 8d404733e1314ef633aa09a90865e94fe711b4ca Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 9 Dec 2021 15:35:13 -0500 Subject: fix mismatched signatures for strtod_l family strtod_l, strtof_l, and strtold_l originally existed only as glibc-ABI-compat symbols. as noted in the commit which added them, 17a60f9d327c6f8b5707a06f9497d846e75c01f2, making them aliases for the non-_l functions was a hack and not appropriate if they ever became public API. unfortunately, commit 35eb1a1a9b97577e113240cd65bf9fc44b8df030 did make them public without undoing the hack. fix that now by moving the the _l functions to their own file as wrappers that just throw away the locale_t argument. --- src/locale/strtod_l.c | 22 ++++++++++++++++++++++ src/stdlib/strtod.c | 7 ------- 2 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 src/locale/strtod_l.c diff --git a/src/locale/strtod_l.c b/src/locale/strtod_l.c new file mode 100644 index 00000000..574ba148 --- /dev/null +++ b/src/locale/strtod_l.c @@ -0,0 +1,22 @@ +#define _GNU_SOURCE +#include +#include + +float strtof_l(const char *restrict s, char **restrict p, locale_t l) +{ + return strtof(s, p); +} + +double strtod_l(const char *restrict s, char **restrict p, locale_t l) +{ + return strtod(s, p); +} + +long double strtold_l(const char *restrict s, char **restrict p, locale_t l) +{ + return strtold(s, p); +} + +weak_alias(strtof_l, __strtof_l); +weak_alias(strtod_l, __strtod_l); +weak_alias(strtold_l, __strtold_l); diff --git a/src/stdlib/strtod.c b/src/stdlib/strtod.c index a5d0118a..39b9daad 100644 --- a/src/stdlib/strtod.c +++ b/src/stdlib/strtod.c @@ -28,10 +28,3 @@ long double strtold(const char *restrict s, char **restrict p) { return strtox(s, p, 2); } - -weak_alias(strtof, strtof_l); -weak_alias(strtod, strtod_l); -weak_alias(strtold, strtold_l); -weak_alias(strtof, __strtof_l); -weak_alias(strtod, __strtod_l); -weak_alias(strtold, __strtold_l); -- cgit v1.2.3 From 775bde6b5c04ecc689ecbb4a25ceaf2ed6ab60c8 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 27 Dec 2021 20:08:31 -0500 Subject: fix wcwidth of hangul combining (vowel/final) letters these characters combine onto a base character (initial) and therefore need to have width 0. the original binary-search implementation of wcwidth handled them correctly, but a regression was introduced in commit 1b0ce9af6d2aa7b92edaf3e9c631cb635bae22bd by generating the new tables from unicode without noticing that the classification logic in use (unicode character category Mn/Me/Cf) was insufficient to catch these characters. --- src/ctype/nonspacing.h | 118 +++++++++++++++++++++++++------------------------ 1 file changed, 60 insertions(+), 58 deletions(-) diff --git a/src/ctype/nonspacing.h b/src/ctype/nonspacing.h index 5d05a3d1..7746f3b6 100644 --- a/src/ctype/nonspacing.h +++ b/src/ctype/nonspacing.h @@ -1,23 +1,23 @@ -16,16,16,18,19,20,21,22,23,24,25,26,27,28,29,30,31,16,16,32,16,16,16,33,34,35, -36,37,38,39,16,16,40,16,16,16,16,16,16,16,16,16,16,16,41,42,16,16,43,16,16,16, +16,16,16,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,16,33,16,16,16,34,35,36, +37,38,39,40,16,16,41,16,16,16,16,16,16,16,16,16,16,16,42,43,16,16,44,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,16,16,16,16,16,16,16,44,16,45,46,47,48,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,45,16,46,47,48,49,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,50,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,51,16,16,52, +53,16,54,55,56,16,16,16,16,16,16,57,16,16,58,16,59,60,61,62,63,64,65,66,67,68, +69,70,16,71,72,73,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,74,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,49,16,16,50, -51,16,52,53,54,16,16,16,16,16,16,55,16,16,56,16,57,58,59,60,61,62,63,64,65,66, -67,68,16,69,70,71,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,72,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,75,76,16,16,16,77,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,73,74,16,16,16,75,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,16,16,16,16,76,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,77,78,16,16,16,16,16,16,16,79,16,16,16,16,16,80,81,82,16,16,16,16,16,83, -84,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,16,16,16,16,16,78,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, +16,16,79,80,16,16,16,16,16,16,16,81,16,16,16,16,16,82,83,84,16,16,16,16,16,85, +86,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, @@ -35,55 +35,57 @@ 242,7,128,127,0,0,0,0,0,0,0,0,0,0,0,0,242,31,0,63,0,0,0,0,0,0,0,0,0,3,0,0,160, 2,0,0,0,0,0,0,254,127,223,224,255,254,255,255,255,31,64,0,0,0,0,0,0,0,0,0,0,0, 0,224,253,102,0,0,0,195,1,0,30,0,100,32,0,32,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0, -0,0,28,0,0,0,12,0,0,0,12,0,0,0,0,0,0,0,176,63,64,254,15,32,0,0,0,0,0,120,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,1,4,14,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,9,0,0,0,0,0,0,64,127, -229,31,248,159,0,0,0,0,0,0,255,127,0,0,0,0,0,0,0,0,15,0,0,0,0,0,208,23,4,0,0, -0,0,248,15,0,3,0,0,0,60,59,0,0,0,0,0,0,64,163,3,0,0,0,0,0,0,240,207,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,255,253,33,16,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255, +0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,28,0,0,0,28,0,0,0,12,0,0,0,12,0,0,0,0,0,0,0,176,63,64,254, +15,32,0,0,0,0,0,120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,2,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,135,1,4,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +128,9,0,0,0,0,0,0,64,127,229,31,248,159,0,0,0,0,0,0,255,127,0,0,0,0,0,0,0,0, +15,0,0,0,0,0,208,23,4,0,0,0,0,248,15,0,3,0,0,0,60,59,0,0,0,0,0,0,64,163,3,0,0, +0,0,0,0,240,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,255,253,33,16, +3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255, 251,0,248,0,0,0,124,0,0,0,0,0,0,223,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255, 255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0, 0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,128,247,63,0,0,0,192,0,0,0,0,0,0,0,0,0,0,3,0,68,8,0,0,96,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,255,255,3,128,0,0,0,0,192,63,0,0,128,255,3,0, -0,0,0,0,7,0,0,0,0,0,200,51,0,0,0,0,32,0,0,0,0,0,0,0,0,126,102,0,8,16,0,0,0,0, -0,16,0,0,0,0,0,0,157,193,2,0,0,0,0,48,64, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,33,0,0,0,0,0,64, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,255,255,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,110,240,0,0,0,0,0,135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0, -0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,192,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,255, -127,0,0,0,0,0,0,128,3,0,0,0,0,0,120,38,0,32,0,0,0,0,0,0,7,0,0,0,128,239,31,0, -0,0,0,0,0,0,8,0,3,0,0,0,0,0,192,127,0,30,0,0,0,0,0,0,0,0,0,0,0,128,211,64,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,248,7,0,0,3,0,0,0,0,0,0,24,1,0,0,0,192, -31,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,92,0,0,64,0,0,0,0,0, -0,0,0,0,0,248,133,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,60,176,1,0,0,48,0,0,0, -0,0,0,0,0,0,0,248,167,1,0,0,0,0,0,0,0,0,0,0,0,0,40,191,0,0,0,0,0,0,0,0,0,0,0, -0,224,188,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -128,255,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,12,1,0,0,0,254,7,0,0,0,0,248,121,128,0, -126,14,0,0,0,0,0,252,127,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,191,0,0,0, -0,0,0,0,0,0,0,252,255,255,252,109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126,180,191,0, -0,0,0,0,0,0,0,0,163,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,24, -0,0,0,0,0,0,0,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,127,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0, -0,128,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,15, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,248,255,231,15,0,0,0,60,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,255,255,255,255,255,255,127,248,255,255,255,255,255,31,32,0,16,0,0,248, -254,255,0,0,0,0,0,0,0,0,0, -0,127,255,255,249,219,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,240,7,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,7,0,0,0,0,0,200,51,0,0,0,0,32,0,0, +0,0,0,0,0,0,126,102,0,8,16,0,0,0,0,0,16,0,0,0,0,0,0,157,193,2,0,0,0,0,48,64,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,33,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,0,0,0, +64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,255, +255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,1,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,110,240,0, +0,0,0,0,135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,240,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,255,1,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,255,127,0,0,0,0,0,0,128, +3,0,0,0,0,0,120,38,0,32,0,0,0,0,0,0,7,0,0,0,128,239,31,0,0,0,0,0,0,0,8,0,3,0, +0,0,0,0,192,127,0,30,0,0,0,0,0,0,0,0,0,0,0,128,211,64,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,128,248,7,0,0,3,0,0,0,0,0,0,24,1,0,0,0,192,31,31,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,255,92,0,0,64,0,0,0,0,0,0,0,0,0,0,248,133,13,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,176,1,0,0,48,0,0,0,0,0,0,0,0,0,0, +248,167,1,0,0,0,0,0,0,0,0,0,0,0,0,40,191,0,0,0,0,0,0,0,0,0,0,0,0,224,188,15,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,255,6,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,240,12,1,0,0,0,254,7,0,0,0,0,248,121,128,0,126,14,0,0,0,0,0,252, +127,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,191,0,0,0,0,0,0,0,0,0,0,252,255, +255,252,109,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,126,180,191,0,0,0,0,0,0,0,0,0,163,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,255, +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,128,7,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,15,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,248,255,231,15,0,0,0,60,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255, +255,255,255,255,127,248,255,255,255,255,255,31,32,0,16,0,0,248,254,255,0,0,0, +0,0,0,0,0,0,0,127,255,255,249,219,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,240,7,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -- cgit v1.2.3 From c4d4028dde90562f631edf559fbc42d8ec1b29de Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Thu, 21 Oct 2021 16:09:30 +0000 Subject: fix failure to use add-cfi scripts on asm when building out-of-tree use $srcdir in configure test for add-cfi script. --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index e1aefed7..ca5cbc0b 100755 --- a/configure +++ b/configure @@ -409,7 +409,7 @@ test "$debug" = yes && CFLAGS_AUTO=-g # printf "checking whether we should preprocess assembly to add debugging information... " if fnmatch '-g*|*\ -g*' "$CFLAGS_AUTO $CFLAGS" && - test -f "tools/add-cfi.$ARCH.awk" && + test -f "$srcdir/tools/add-cfi.$ARCH.awk" && printf ".file 1 \"srcfile.s\"\n.line 1\n.cfi_startproc\n.cfi_endproc" | $CC -g -x assembler -c -o /dev/null 2>/dev/null - then ADD_CFI=yes -- cgit v1.2.3 From cbacd638e32a02edbe66c48ae3d1361bc06a492a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Fri, 17 Dec 2021 04:59:43 -0300 Subject: add SEEK_DATA and SEEK_HOLE to unistd.h these are linux specific constants. glibc exposes them behind _GNU_SOURCE, but, since SEEK_* is reserved for the implementation, we can simply define them. furthermore, since they can't be used with fseek() and other functions that deal with FILE, we don't add them to stdio.h. --- include/unistd.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/unistd.h b/include/unistd.h index ee2dbe8a..212263a7 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -14,6 +14,8 @@ extern "C" { #define SEEK_SET 0 #define SEEK_CUR 1 #define SEEK_END 2 +#define SEEK_DATA 3 +#define SEEK_HOLE 4 #if __cplusplus >= 201103L #define NULL nullptr -- cgit v1.2.3 From 52f0deb96975401d9f13334dc37f907630224af7 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 9 Jan 2022 00:33:56 -0500 Subject: make fseek detect and produce an error for invalid whence arguments this is a POSIX requirement. we previously relied on the underlying fd (or other backend) seek operation to produce the error, but since linux lseek now supports other seek modes (SEEK_DATA and SEEK_HOLE) which do not interact well with stdio buffering, this is insufficient. instead, explicitly check whence before performing any operations. --- src/stdio/fseek.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/stdio/fseek.c b/src/stdio/fseek.c index 439308f7..c07f7e95 100644 --- a/src/stdio/fseek.c +++ b/src/stdio/fseek.c @@ -1,7 +1,14 @@ #include "stdio_impl.h" +#include int __fseeko_unlocked(FILE *f, off_t off, int whence) { + /* Fail immediately for invalid whence argument. */ + if (whence != SEEK_CUR && whence != SEEK_SET && whence != SEEK_END) { + errno = EINVAL; + return -1; + } + /* Adjust relative offset for unread data in buffer, if any. */ if (whence == SEEK_CUR && f->rend) off -= f->rend - f->rpos; -- cgit v1.2.3 From 75b3412f3dbda8f1fc6818b8b0cf1d0737c2163c Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 18 Jan 2022 17:31:46 -0500 Subject: fix potentially wrong-sign zero in cproj functions at infinity these are specified to use the sign of the imaginary part of the input as the sign of zero in the result, but wrongly copied the sign of the real part. --- src/complex/cproj.c | 2 +- src/complex/cprojf.c | 2 +- src/complex/cprojl.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/complex/cproj.c b/src/complex/cproj.c index 9ae1e17c..d2b8f5a9 100644 --- a/src/complex/cproj.c +++ b/src/complex/cproj.c @@ -3,6 +3,6 @@ double complex cproj(double complex z) { if (isinf(creal(z)) || isinf(cimag(z))) - return CMPLX(INFINITY, copysign(0.0, creal(z))); + return CMPLX(INFINITY, copysign(0.0, cimag(z))); return z; } diff --git a/src/complex/cprojf.c b/src/complex/cprojf.c index 03fab339..15a874bb 100644 --- a/src/complex/cprojf.c +++ b/src/complex/cprojf.c @@ -3,6 +3,6 @@ float complex cprojf(float complex z) { if (isinf(crealf(z)) || isinf(cimagf(z))) - return CMPLXF(INFINITY, copysignf(0.0, crealf(z))); + return CMPLXF(INFINITY, copysignf(0.0, cimagf(z))); return z; } diff --git a/src/complex/cprojl.c b/src/complex/cprojl.c index 38a494c5..531ffa1c 100644 --- a/src/complex/cprojl.c +++ b/src/complex/cprojl.c @@ -9,7 +9,7 @@ long double complex cprojl(long double complex z) long double complex cprojl(long double complex z) { if (isinf(creall(z)) || isinf(cimagl(z))) - return CMPLXL(INFINITY, copysignl(0.0, creall(z))); + return CMPLXL(INFINITY, copysignl(0.0, cimagl(z))); return z; } #endif -- cgit v1.2.3 From 3b7b4155570b4b9054465785be2992c92cb7d7b1 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 9 Feb 2022 17:48:43 -0500 Subject: fix out-of-bound read processing time zone data with distant-past dates this bug goes back to commit 1cc81f5cb0df2b66a795ff0c26d7bbc4d16e13c6 where zoneinfo file support was first added. in scan_trans, which searches for the appropriate local time/dst rule in effect at a given time, times prior to the second transition time caused the -1 slot of the index to be read to determine the previous rule in effect. this memory was always valid (part of another zoneinfo table in the mapped file) but the byte value read was then used to index another table, possibly going outside the bounds of the mmap. most of the time, the result was limited to misinterpretation of the rule in effect at that time (pre-1900s), but it could produce a crash if adjacent memory was not readable. the root cause of the problem, however, was that the logic for this code path was all wrong. as documented in the comment, times before the first transition should be treated as using the lowest-numbered non-dst rule, or rule 0 if no non-dst rules exist. if the argument is in units of local time, however, the rule prior to the first transition is needed to determine if it falls before or after it, and that's where the -1 index was wrongly used. instead, use the documented logic to find out what rule would be in effect before the first transition, and apply it as the offset if the argument was given in local time. the new code has not been heavily tested, but no longer performs potentially out-of-bounds accesses, and successfully handles the 1883 transition from local mean time to central standard time in the test case the error was reported for. --- src/time/__tz.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/time/__tz.c b/src/time/__tz.c index 3e2fcdcb..c34b3eb7 100644 --- a/src/time/__tz.c +++ b/src/time/__tz.c @@ -293,22 +293,20 @@ static size_t scan_trans(long long t, int local, size_t *alt) n = (index-trans)>>scale; if (a == n-1) return -1; if (a == 0) { - x = zi_read32(trans + (a< Date: Thu, 10 Feb 2022 17:32:43 -0800 Subject: Add linker scripts for embedded linker to sysroot Add linker scripts that trick clang into produce a binary with the embedded dynamic linker. Scrt1.o is now a linker script that includes the original Scrt1.o and libc_musl_linker_object.o that contains the linker and the trampoline, as well as the linker.script that puts the linker in the right place. libc.so is a linker script that forwards to libc_musl.so. Bug: 216192129 Test: manual Change-Id: Ibbc749460fb856c57deda87b9ed3c252b67a708f --- Android.bp | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/Android.bp b/Android.bp index 2c7c6bb3..19c46fef 100644 --- a/Android.bp +++ b/Android.bp @@ -615,6 +615,23 @@ cc_library_static { ], } +// The linker and trampoline compiled as a .o file to use as part of the sysroot +// crt. +cc_object { + name: "libc_musl_linker_object", + defaults: ["libc_musl_defaults"], + srcs: [ + ":musl_linker_asm", + "android/ldso_trampoline.cpp", + ], + cflags: [ + // These are required to make sure the C code in ldso_trampoline.c + // doesn't have any dependencies on libc. + "-fno-stack-protector", + "-ftrivial-auto-var-init=uninitialized", + ], +} + // The architecture-specific bits have to be handled separately because the label varies based // on architecture, which prevents using $(locations) to find them and requires using $(in) // instead, which would mix in all the other files if this were part of the main libc_musl_sysroot @@ -696,11 +713,8 @@ cc_genrule { ":libc_musl_rcrt1", ":libc_musl_Scrt1", - // Embedded linker objects - ":libc_musl_crtbegin_dynamic", - ":libc_musl_crtbegin_static", - ":libc_musl_crtbegin_so", - ":libc_musl_crtend", + // Embedded linker objects and linker scripts + ":libc_musl_linker_object", ":musl_linker_script", // Wrapper scripts @@ -719,6 +733,9 @@ cc_genrule { cmd: "includes=($(locations include/**/*.h)) && " + "bits=($(locations arch/generic/bits/*.h)) && " + "android_bits=($(locations android/include/bits/*.h)) && " + + "ln -s libc_musl.so $(genDir)/ld-musl.so.1 && " + + "echo -e 'GROUP ( Scrt1-real.o libc_musl_linker_object.o )\nINCLUDE linker.script' > $(genDir)/Scrt1.ld && " + + "echo -e 'GROUP ( libc_musl.so )' > $(genDir)/libc.so && " + "$(location soong_zip) -o $(genDir)/sysroot.zip " + " -j " + " -f $(location LICENSE) " + @@ -740,13 +757,13 @@ cc_genrule { " -f $(location :libc_musl_crtn) " + " -f $(location :libc_musl_crt1) " + " -f $(location :libc_musl_rcrt1) " + - " -f $(location :libc_musl_Scrt1) " + // embedded linker crt objects - " -f $(location :libc_musl_crtbegin_dynamic) " + - " -f $(location :libc_musl_crtbegin_static) " + - " -f $(location :libc_musl_crtbegin_so) " + - " -f $(location :libc_musl_crtend) " + " -f $(location :musl_linker_script) " + + " -f $(location :libc_musl_linker_object) " + + // libs + " -f $(location :libc_musl) " + + " -f $(genDir)/ld-musl.so.1 " + + " -f $(genDir)/libc.so " + // clang wrappers " -P bin -j " + " -f $(location :libc_musl_clang_wrapper) " + @@ -755,17 +772,17 @@ cc_genrule { // libs in a separate zip so they can be renamed "$(location soong_zip) -o $(genDir)/libs.zip " + " -P lib -j " + - " -f $(location :libc_musl) " + - " -f $(location :libc_musl_for_sysroot) " + " -f $(location :libc_musl_static) " + " -f $(location :libc_musl_sysroot_static_empty) " + + " -f $(genDir)/Scrt1.ld " + + " -f $(location :libc_musl_Scrt1) " + " && " + "$(location zip2zip) -i $(genDir)/libs.zip -o $(genDir)/libs_renamed.zip " + // rename libs from module names to desired names in sysroot " lib/libc_musl_static.a:lib/libc.a " + - " lib/libc_musl.so:lib/libc_musl.so " + - " lib/libc_musl_for_sysroot.so:lib/libc.so " + - " lib/libc_musl_for_sysroot.so:lib/ld-musl.so.1 " + + // Swap in linker script for Scrt1.o + " lib/Scrt1.o:lib/Scrt1-real.o " + + " lib/Scrt1.ld:lib/Scrt1.o " + // copy empty static libs " lib/libc_musl_sysroot_static_empty.a:lib/libcrypt.a " + " lib/libc_musl_sysroot_static_empty.a:lib/libdl.a " + -- cgit v1.2.3 From 5690668a1bb9f551bb78d825bc804dcebe84b7e7 Mon Sep 17 00:00:00 2001 From: pelco Date: Wed, 16 Feb 2022 23:06:17 +0000 Subject: add missing strerror text for key management --- src/errno/__strerror.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/errno/__strerror.h b/src/errno/__strerror.h index 2d992da5..14925907 100644 --- a/src/errno/__strerror.h +++ b/src/errno/__strerror.h @@ -102,3 +102,7 @@ E(EDQUOT, "Quota exceeded") E(ENOMEDIUM, "No medium found") E(EMEDIUMTYPE, "Wrong medium type") E(EMULTIHOP, "Multihop attempted") +E(ENOKEY, "Required key not available") +E(EKEYEXPIRED, "Key has expired") +E(EKEYREVOKED, "Key has been revoked") +E(EKEYREJECTED, "Key was rejected by service") -- cgit v1.2.3 From f8bdc3048216f41eaaf655524fa286cfb1184a70 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 20 Feb 2022 20:11:14 -0500 Subject: fix spurious failures by fgetws when buffer ends with partial character commit a90d9da1d1b14d81c4f93e1a6d1a686c3312e4ba made fgetws look for changes to errno by fgetwc to detect encoding errors, since ISO C did not allow the implementation to set the stream's error flag in this case, and the fgetwc interface did not admit any other way to detect the error. however, the possibility of fgetwc setting errno to EILSEQ in the success path was overlooked, and in fact this can happen if the buffer ends with a partial character, causing mbtowc to be called with only part of the character available. since that change was made, the C standard was amended to specify that fgetwc set the stream error flag on encoding errors, and commit 511d70738bce11a67219d0132ce725c323d00e4e made it do so. thus, there is no longer any need for fgetws to poke at errno to handle encoding errors. this commit reverts commit a90d9da1d1b14d81c4f93e1a6d1a686c3312e4ba and thereby fixes the problem. --- src/stdio/fgetws.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/stdio/fgetws.c b/src/stdio/fgetws.c index b08b3049..195cb435 100644 --- a/src/stdio/fgetws.c +++ b/src/stdio/fgetws.c @@ -1,6 +1,5 @@ #include "stdio_impl.h" #include -#include wint_t __fgetwc_unlocked(FILE *); @@ -12,10 +11,6 @@ wchar_t *fgetws(wchar_t *restrict s, int n, FILE *restrict f) FLOCK(f); - /* Setup a dummy errno so we can detect EILSEQ. This is - * the only way to catch encoding errors in the form of a - * partial character just before EOF. */ - errno = EAGAIN; for (; n; n--) { wint_t c = __fgetwc_unlocked(f); if (c == WEOF) break; @@ -23,7 +18,7 @@ wchar_t *fgetws(wchar_t *restrict s, int n, FILE *restrict f) if (c == '\n') break; } *p = 0; - if (ferror(f) || errno==EILSEQ) p = s; + if (ferror(f)) p = s; FUNLOCK(f); -- cgit v1.2.3 From 588f5ad348eaba35935cf8747c5aed7947ebdfb5 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 25 Feb 2022 18:28:41 -0800 Subject: Include libc++ and libc++abi in musl sysroot Include libc++ and libc++abi in the musl sysroots so that the clang runtimes can link against them. Bug: 215802826 Test: musl llvm build Change-Id: Ieb0d49b80832709aa589bae3264cf4c2e684825b --- Android.bp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Android.bp b/Android.bp index 19c46fef..51bd2024 100644 --- a/Android.bp +++ b/Android.bp @@ -701,10 +701,16 @@ cc_genrule { // Bionic kernel uapi headers ":libc_musl_sysroot_bionic_headers", + // libc++ headers + ":libc_musl_sysroot_libc++_headers", + ":libc_musl_sysroot_libc++abi_headers", + // Libraries ":libc_musl", ":libc_musl_for_sysroot", ":libc_musl_static", + ":libc++abi", + ":libc++", // Objects ":libc_musl_crti", @@ -762,6 +768,8 @@ cc_genrule { " -f $(location :libc_musl_linker_object) " + // libs " -f $(location :libc_musl) " + + " -f $(location :libc++abi) " + + " -f $(location :libc++) " + " -f $(genDir)/ld-musl.so.1 " + " -f $(genDir)/libc.so " + // clang wrappers @@ -793,8 +801,13 @@ cc_genrule { " lib/libc_musl_sysroot_static_empty.a:lib/libutil.a " + " lib/libc_musl_sysroot_static_empty.a:lib/libxnet.a " + " && " + - "$(location merge_zips) -ignore-duplicates $(out) $(location :libc_musl_sysroot_bionic_headers) " + - " $(location :libc_musl_sysroot_bits) $(genDir)/sysroot.zip $(genDir)/libs_renamed.zip", + "$(location merge_zips) -ignore-duplicates $(out) " + + " $(location :libc_musl_sysroot_bionic_headers) " + + " $(location :libc_musl_sysroot_libc++_headers) " + + " $(location :libc_musl_sysroot_libc++abi_headers) " + + " $(location :libc_musl_sysroot_bits) " + + " $(genDir)/sysroot.zip " + + " $(genDir)/libs_renamed.zip", } build=["sources.bp"] -- cgit v1.2.3 From 20d468b1fb706e19044789b2331148581ac9b9da Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 28 Feb 2022 19:48:03 -0800 Subject: Mark _start reference as hidden Mark the _start symbol as hidden in ldso_trampoline.cpp so that the compiler uses an R_386_GOTOFF relocation instead of a R_386_GOT32X relocation. The former uses an offset from the GOT table, which is at a location known at link time, while the latter needs to load a value out of the GOT table, which has not yet been initialized. Bug: 216192129 Test: 32-bit gtest Change-Id: I2ead955b8bc1cacae6c9af06270f5b20bba39ec7 --- android/ldso_trampoline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/ldso_trampoline.cpp b/android/ldso_trampoline.cpp index 16288ea2..72b550c5 100644 --- a/android/ldso_trampoline.cpp +++ b/android/ldso_trampoline.cpp @@ -45,7 +45,7 @@ __attribute__((visibility("hidden"))) extern const char __dlwrap_linker; __attribute__((visibility("hidden"))) extern const char __dlwrap_linker_end; // The real entry point of the binary to use after linker bootstrapping. -extern "C" void _start(); +__attribute__((visibility("hidden"))) extern "C" void _start(); // Allocate some R/W memory to store a copy of the program headers. static ElfW(Phdr) phdr_copy[64]; -- cgit v1.2.3 From e2820e749f89ca41ed0d6a6ec3e02641c7177370 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 10 Feb 2022 17:32:09 -0800 Subject: Add libunwind to libc_musl.so Embed libunwind in libc_musl.so to provide the _Unwind* symbols, which allows removing the dependency on libgcc. Bug: 215802826 Test: m USE_HOST_MUSL=true host-native Change-Id: I786354ba916e5cb568ea291a31b197b52f0cbfa7 --- Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/Android.bp b/Android.bp index 51bd2024..2404954b 100644 --- a/Android.bp +++ b/Android.bp @@ -235,6 +235,7 @@ cc_library_static { "libc_musl_nossp", "libexecinfo", "libb64", + "libunwind", ], multilib: { lib32: { -- cgit v1.2.3 From 7c0c7a75ec8ecf3eedefc40bb4dae5aaa76d7108 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 4 Feb 2022 21:04:45 +0100 Subject: math: avoid runtime conversions of floating-point constants gcc-12 with -frounding-mode will do inexact constant conversions at runtime according to the runtime rounding mode. in the math library we want constants to be rounding mode independent so this patch fixes cases where new runtime conversions happen with gcc-12. fortunately this only affects two minor cases, the fix uses global initializers where rounding mode does not apply. after the patch the same amount of conversions happen with gcc-12 as with gcc-11. --- src/complex/cacosf.c | 4 +++- src/complex/catanf.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/complex/cacosf.c b/src/complex/cacosf.c index 2e048540..ed8acf0f 100644 --- a/src/complex/cacosf.c +++ b/src/complex/cacosf.c @@ -2,8 +2,10 @@ // FIXME +static const float float_pi_2 = M_PI_2; + float complex cacosf(float complex z) { z = casinf(z); - return CMPLXF((float)M_PI_2 - crealf(z), -cimagf(z)); + return CMPLXF(float_pi_2 - crealf(z), -cimagf(z)); } diff --git a/src/complex/catanf.c b/src/complex/catanf.c index ef3907a5..1d569f2d 100644 --- a/src/complex/catanf.c +++ b/src/complex/catanf.c @@ -61,13 +61,15 @@ static const double DP1 = 3.140625; static const double DP2 = 9.67502593994140625E-4; static const double DP3 = 1.509957990978376432E-7; +static const float float_pi = M_PI; + static float _redupif(float xx) { float x, t; long i; x = xx; - t = x/(float)M_PI; + t = x/float_pi; if (t >= 0.0f) t += 0.5f; else -- cgit v1.2.3 From 74a28a8af21977ebbc2945beb879f1b9b6ff13ba Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 13 Dec 2021 21:05:19 +0100 Subject: protect stack canary from leak via read-as-string by zeroing second byte This reduces entropy of the canary from 64-bit to 56-bit in exchange for mitigating non-terminated C string overflows by setting the second byte of the canary to nul, so that off-by-one write overflow with a nul byte can still be detected. Idea from GrapheneOS bionic commit 7024d880b51f03a796ff8832f1298f2f1531fd7b --- src/env/__stack_chk_fail.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/env/__stack_chk_fail.c b/src/env/__stack_chk_fail.c index bf5a280a..e5352602 100644 --- a/src/env/__stack_chk_fail.c +++ b/src/env/__stack_chk_fail.c @@ -9,6 +9,15 @@ void __init_ssp(void *entropy) if (entropy) memcpy(&__stack_chk_guard, entropy, sizeof(uintptr_t)); else __stack_chk_guard = (uintptr_t)&__stack_chk_guard * 1103515245; +#if UINTPTR_MAX >= 0xffffffffffffffff + /* Sacrifice 8 bits of entropy on 64bit to prevent leaking/ + * overwriting the canary via string-manipulation functions. + * The NULL byte is on the second byte so that off-by-ones can + * still be detected. Endianness is taken care of + * automatically. */ + ((char *)&__stack_chk_guard)[1] = 0; +#endif + __pthread_self()->canary = __stack_chk_guard; } -- cgit v1.2.3 From 3aba2150d0efc80df30d7fc6c22d6041e14d445e Mon Sep 17 00:00:00 2001 From: Alexey Kodanev Date: Tue, 29 Jun 2021 16:31:30 +0300 Subject: nice: return EPERM instead of EACCES To comply with POSIX, change errno from EACCES to EPERM when the caller did not have the required privilege. --- src/unistd/nice.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/unistd/nice.c b/src/unistd/nice.c index 6c25c8c3..1c2295ff 100644 --- a/src/unistd/nice.c +++ b/src/unistd/nice.c @@ -1,4 +1,5 @@ #include +#include #include #include #include "syscall.h" @@ -12,5 +13,11 @@ int nice(int inc) prio += getpriority(PRIO_PROCESS, 0); if (prio > NZERO-1) prio = NZERO-1; if (prio < -NZERO) prio = -NZERO; - return setpriority(PRIO_PROCESS, 0, prio) ? -1 : prio; + if (setpriority(PRIO_PROCESS, 0, prio)) { + if (errno == EACCES) + errno = EPERM; + return -1; + } else { + return prio; + } } -- cgit v1.2.3 From b21f3ded780cc8fd8e510c99aeaf4a453d8c8a22 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 7 Mar 2021 19:21:34 +0000 Subject: bits/syscall.h: add epoll_pwait2 from linux v5.11 see linux commit b0a0c2615f6f199a656ed8549d7dce625d77aa77 epoll: wire up syscall epoll_pwait2 linux commit 58169a52ebc9a733aeb5bea857bc5daa71a301bb epoll: add syscall epoll_pwait2 epoll_wait with struct timespec timeout instead of int. no time32 variant. --- arch/aarch64/bits/syscall.h.in | 1 + arch/arm/bits/syscall.h.in | 1 + arch/i386/bits/syscall.h.in | 1 + arch/m68k/bits/syscall.h.in | 1 + arch/microblaze/bits/syscall.h.in | 1 + arch/mips/bits/syscall.h.in | 1 + arch/mips64/bits/syscall.h.in | 1 + arch/mipsn32/bits/syscall.h.in | 1 + arch/or1k/bits/syscall.h.in | 1 + arch/powerpc/bits/syscall.h.in | 1 + arch/powerpc64/bits/syscall.h.in | 1 + arch/riscv64/bits/syscall.h.in | 1 + arch/s390x/bits/syscall.h.in | 1 + arch/sh/bits/syscall.h.in | 1 + arch/x32/bits/syscall.h.in | 1 + arch/x86_64/bits/syscall.h.in | 1 + 16 files changed, 16 insertions(+) diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in index 1ad467c0..e955da4d 100644 --- a/arch/aarch64/bits/syscall.h.in +++ b/arch/aarch64/bits/syscall.h.in @@ -294,4 +294,5 @@ #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 #define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in index cf9e3411..2a55d4db 100644 --- a/arch/arm/bits/syscall.h.in +++ b/arch/arm/bits/syscall.h.in @@ -394,6 +394,7 @@ #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 #define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 #define __ARM_NR_breakpoint 0x0f0001 #define __ARM_NR_cacheflush 0x0f0002 diff --git a/arch/i386/bits/syscall.h.in b/arch/i386/bits/syscall.h.in index 5d1c4d7a..f900db2e 100644 --- a/arch/i386/bits/syscall.h.in +++ b/arch/i386/bits/syscall.h.in @@ -431,4 +431,5 @@ #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 #define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 diff --git a/arch/m68k/bits/syscall.h.in b/arch/m68k/bits/syscall.h.in index 6794b1a0..e064b445 100644 --- a/arch/m68k/bits/syscall.h.in +++ b/arch/m68k/bits/syscall.h.in @@ -411,3 +411,4 @@ #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 #define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in index 7f71df3b..86fe8271 100644 --- a/arch/microblaze/bits/syscall.h.in +++ b/arch/microblaze/bits/syscall.h.in @@ -432,4 +432,5 @@ #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 #define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in index d54845b2..83c9655d 100644 --- a/arch/mips/bits/syscall.h.in +++ b/arch/mips/bits/syscall.h.in @@ -413,4 +413,5 @@ #define __NR_pidfd_getfd 4438 #define __NR_faccessat2 4439 #define __NR_process_madvise 4440 +#define __NR_epoll_pwait2 4441 diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in index 920b4358..1be9f3e1 100644 --- a/arch/mips64/bits/syscall.h.in +++ b/arch/mips64/bits/syscall.h.in @@ -343,4 +343,5 @@ #define __NR_pidfd_getfd 5438 #define __NR_faccessat2 5439 #define __NR_process_madvise 5440 +#define __NR_epoll_pwait2 5441 diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in index e6dad688..1bd7aeb2 100644 --- a/arch/mipsn32/bits/syscall.h.in +++ b/arch/mipsn32/bits/syscall.h.in @@ -367,4 +367,5 @@ #define __NR_pidfd_getfd 6438 #define __NR_faccessat2 6439 #define __NR_process_madvise 6440 +#define __NR_epoll_pwait2 6441 diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in index 463ee901..499aa832 100644 --- a/arch/or1k/bits/syscall.h.in +++ b/arch/or1k/bits/syscall.h.in @@ -316,4 +316,5 @@ #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 #define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in index db4d0ca4..7f7d5a11 100644 --- a/arch/powerpc/bits/syscall.h.in +++ b/arch/powerpc/bits/syscall.h.in @@ -420,4 +420,5 @@ #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 #define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in index a128890b..b5793172 100644 --- a/arch/powerpc64/bits/syscall.h.in +++ b/arch/powerpc64/bits/syscall.h.in @@ -392,4 +392,5 @@ #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 #define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 diff --git a/arch/riscv64/bits/syscall.h.in b/arch/riscv64/bits/syscall.h.in index 39c0d650..df6bf5c2 100644 --- a/arch/riscv64/bits/syscall.h.in +++ b/arch/riscv64/bits/syscall.h.in @@ -294,6 +294,7 @@ #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 #define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 #define __NR_sysriscv __NR_arch_specific_syscall #define __NR_riscv_flush_icache (__NR_sysriscv + 15) diff --git a/arch/s390x/bits/syscall.h.in b/arch/s390x/bits/syscall.h.in index 9c8d984e..16ec02ee 100644 --- a/arch/s390x/bits/syscall.h.in +++ b/arch/s390x/bits/syscall.h.in @@ -357,4 +357,5 @@ #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 #define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 diff --git a/arch/sh/bits/syscall.h.in b/arch/sh/bits/syscall.h.in index 17dd7e07..4fc1f9e8 100644 --- a/arch/sh/bits/syscall.h.in +++ b/arch/sh/bits/syscall.h.in @@ -404,4 +404,5 @@ #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 #define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in index 5361442e..14c7231f 100644 --- a/arch/x32/bits/syscall.h.in +++ b/arch/x32/bits/syscall.h.in @@ -303,6 +303,7 @@ #define __NR_pidfd_getfd (0x40000000 + 438) #define __NR_faccessat2 (0x40000000 + 439) #define __NR_process_madvise (0x40000000 + 440) +#define __NR_epoll_pwait2 (0x40000000 + 441) #define __NR_rt_sigaction (0x40000000 + 512) diff --git a/arch/x86_64/bits/syscall.h.in b/arch/x86_64/bits/syscall.h.in index e943883d..f611884e 100644 --- a/arch/x86_64/bits/syscall.h.in +++ b/arch/x86_64/bits/syscall.h.in @@ -350,4 +350,5 @@ #define __NR_pidfd_getfd 438 #define __NR_faccessat2 439 #define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 -- cgit v1.2.3 From f35b99b38721c0e76152069254b642dd345da784 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 7 Mar 2021 20:50:17 +0000 Subject: sys/prctl.h: add PR_SET_SYSCALL_USER_DISPATCH from linux v5.11 see linux commit 1446e1df9eb183fdf81c3f0715402f1d7595d4cb kernel: Implement selective syscall userspace redirection linux commit 36a6c843fd0d8e02506681577e96dabd203dd8e8 entry: Use different define for selector variable in SUD redirect syscalls to a userspace handler via SIGSYS, except for a specific range of code. can be toggled via a memory write to a selector variable. mainly for wine. --- include/sys/prctl.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/sys/prctl.h b/include/sys/prctl.h index 4ba73f42..3f0254c7 100644 --- a/include/sys/prctl.h +++ b/include/sys/prctl.h @@ -168,6 +168,12 @@ struct prctl_mm_map { #define PR_SET_IO_FLUSHER 57 #define PR_GET_IO_FLUSHER 58 +#define PR_SET_SYSCALL_USER_DISPATCH 59 +#define PR_SYS_DISPATCH_OFF 0 +#define PR_SYS_DISPATCH_ON 1 +#define SYSCALL_DISPATCH_FILTER_ALLOW 0 +#define SYSCALL_DISPATCH_FILTER_BLOCK 1 + int prctl (int, ...); #ifdef __cplusplus -- cgit v1.2.3 From c5ecaca743e4d6c1be7e3fd91dee62e560acb7e2 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 7 Mar 2021 21:19:36 +0000 Subject: sys/socket.h: add new SO_ socket options from linux v5.11 see linux commit 7fd3253a7de6a317a0683f83739479fb880bffc8 net: Introduce preferred busy-polling linux commit 7c951cafc0cb2e575f1d58677b95ac387ac0a5bd net: Add SO_BUSY_POLL_BUDGET socket option --- include/sys/socket.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/sys/socket.h b/include/sys/socket.h index 38f5bb17..6dc1e40a 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -289,6 +289,8 @@ struct linger { #define SCM_TXTIME SO_TXTIME #define SO_BINDTOIFINDEX 62 #define SO_DETACH_REUSEPORT_BPF 68 +#define SO_PREFER_BUSY_POLL 69 +#define SO_BUSY_POLL_BUDGET 70 #ifndef SOL_SOCKET #define SOL_SOCKET 1 -- cgit v1.2.3 From b54f481fbcc5637226fc3d2e0404b7f95b3e2f14 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 7 Mar 2021 21:33:25 +0000 Subject: netinet/if_ether.h: add ETH_P_CFM from linux v5.11 see linux commit fbaedb4129838252570410c65abb2036b5505cbd bridge: uapi: cfm: Added EtherType used by the CFM protocol. --- include/netinet/if_ether.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h index 55a2ff1b..3479f511 100644 --- a/include/netinet/if_ether.h +++ b/include/netinet/if_ether.h @@ -66,6 +66,7 @@ #define ETH_P_1588 0x88F7 #define ETH_P_NCSI 0x88F8 #define ETH_P_PRP 0x88FB +#define ETH_P_CFM 0x8902 #define ETH_P_FCOE 0x8906 #define ETH_P_TDLS 0x890D #define ETH_P_FIP 0x8914 -- cgit v1.2.3 From 30c8a1456ab7a005360f5315ba96f8073593ab51 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 7 Mar 2021 21:39:24 +0000 Subject: netinet/tcp.h: add tcp zerocopy related changes from linux v5.11 see linux commit 18fb76ed53865c1b5d5f0157b1b825704590beb5 net-zerocopy: Copy straggler unaligned data for TCP Rx. zerocopy. linux commit 94ab9eb9b234ddf23af04a4bc7e8db68e67b8778 net-zerocopy: Defer vm zap unless actually needed. --- include/netinet/tcp.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h index b7b997f5..30f20239 100644 --- a/include/netinet/tcp.h +++ b/include/netinet/tcp.h @@ -281,12 +281,17 @@ struct tcp_repair_window { uint32_t rcv_wup; }; +#define TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT 0x1 + struct tcp_zerocopy_receive { uint64_t address; uint32_t length; uint32_t recv_skip_hint; uint32_t inq; int32_t err; + uint64_t copybuf_address; + int32_t copybuf_len; + uint32_t flags; }; #endif -- cgit v1.2.3 From 3dcbd896907d9d474da811b7c6b769342abaf651 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 7 Mar 2021 22:15:11 +0000 Subject: signal.h: add si_code values for SIGSYS unlike other si_code defines, SYS_ is not in the posix reserved namespace which is likely the reason why SYS_SECCOMP was previously missing (was new in linux v3.5). --- include/signal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/signal.h b/include/signal.h index f270a594..4dd46142 100644 --- a/include/signal.h +++ b/include/signal.h @@ -261,6 +261,8 @@ void (*sigset(int, void (*)(int)))(int); #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) #define NSIG _NSIG typedef void (*sig_t)(int); + +#define SYS_SECCOMP 1 #endif #ifdef _GNU_SOURCE -- cgit v1.2.3 From 993cccce13ba3ae0432cb06eacd2e7f55a090952 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 7 Mar 2021 22:20:54 +0000 Subject: signal.h: add SYS_USER_DISPATCH si_code value from linux v5.11 see linux commit 1d7637d89cfce54a4f4a41c2325288c2f47470e8 signal: Expose SYS_USER_DISPATCH si_code type --- include/signal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/signal.h b/include/signal.h index 4dd46142..af940ccb 100644 --- a/include/signal.h +++ b/include/signal.h @@ -263,6 +263,7 @@ void (*sigset(int, void (*)(int)))(int); typedef void (*sig_t)(int); #define SYS_SECCOMP 1 +#define SYS_USER_DISPATCH 2 #endif #ifdef _GNU_SOURCE -- cgit v1.2.3 From e99c4258275507c576d7d5bebdba1a8aadf120c4 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 17 Mar 2021 19:19:27 +0000 Subject: signal.h: add new sa_flags from linux v5.11 see linux commit a54f0dfda754c5cecc89a14dab68a3edc1e497b5 signal: define the SA_UNSUPPORTED bit in sa_flags linux commit 6ac05e832a9e96f9b1c42a8917cdd317d7b6c8fa signal: define the SA_EXPOSE_TAGBITS bit in sa_flags Note: SA_ is in the posix reserved namespace so these linux specific flags can be exposed when compiling for posix. --- include/signal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/signal.h b/include/signal.h index af940ccb..c347f861 100644 --- a/include/signal.h +++ b/include/signal.h @@ -178,6 +178,9 @@ struct sigaction { #define sa_handler __sa_handler.sa_handler #define sa_sigaction __sa_handler.sa_sigaction +#define SA_UNSUPPORTED 0x00000400 +#define SA_EXPOSE_TAGBITS 0x00000800 + struct sigevent { union sigval sigev_value; int sigev_signo; -- cgit v1.2.3 From f7d3db5bfc4c3b2315dd8c3137f0f332e1c6896a Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 25 May 2021 20:53:18 +0000 Subject: bits/syscall.h: add mount_setattr from linux v5.12 new syscall to change the properties of a mount or a mount tree using file descriptors which the new mount api is based on, see linux commit 2a1867219c7b27f928e2545782b86daaf9ad50bd fs: add mount_setattr() --- arch/aarch64/bits/syscall.h.in | 1 + arch/arm/bits/syscall.h.in | 1 + arch/i386/bits/syscall.h.in | 1 + arch/m68k/bits/syscall.h.in | 1 + arch/microblaze/bits/syscall.h.in | 1 + arch/mips/bits/syscall.h.in | 1 + arch/mips64/bits/syscall.h.in | 1 + arch/mipsn32/bits/syscall.h.in | 1 + arch/or1k/bits/syscall.h.in | 1 + arch/powerpc/bits/syscall.h.in | 1 + arch/powerpc64/bits/syscall.h.in | 1 + arch/riscv64/bits/syscall.h.in | 1 + arch/s390x/bits/syscall.h.in | 1 + arch/sh/bits/syscall.h.in | 1 + arch/x32/bits/syscall.h.in | 1 + arch/x86_64/bits/syscall.h.in | 1 + 16 files changed, 16 insertions(+) diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in index e955da4d..037da214 100644 --- a/arch/aarch64/bits/syscall.h.in +++ b/arch/aarch64/bits/syscall.h.in @@ -295,4 +295,5 @@ #define __NR_faccessat2 439 #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in index 2a55d4db..8919137f 100644 --- a/arch/arm/bits/syscall.h.in +++ b/arch/arm/bits/syscall.h.in @@ -395,6 +395,7 @@ #define __NR_faccessat2 439 #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 #define __ARM_NR_breakpoint 0x0f0001 #define __ARM_NR_cacheflush 0x0f0002 diff --git a/arch/i386/bits/syscall.h.in b/arch/i386/bits/syscall.h.in index f900db2e..4c04ea89 100644 --- a/arch/i386/bits/syscall.h.in +++ b/arch/i386/bits/syscall.h.in @@ -432,4 +432,5 @@ #define __NR_faccessat2 439 #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 diff --git a/arch/m68k/bits/syscall.h.in b/arch/m68k/bits/syscall.h.in index e064b445..136775b4 100644 --- a/arch/m68k/bits/syscall.h.in +++ b/arch/m68k/bits/syscall.h.in @@ -412,3 +412,4 @@ #define __NR_faccessat2 439 #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in index 86fe8271..10f27aba 100644 --- a/arch/microblaze/bits/syscall.h.in +++ b/arch/microblaze/bits/syscall.h.in @@ -433,4 +433,5 @@ #define __NR_faccessat2 439 #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in index 83c9655d..1d0deed3 100644 --- a/arch/mips/bits/syscall.h.in +++ b/arch/mips/bits/syscall.h.in @@ -414,4 +414,5 @@ #define __NR_faccessat2 4439 #define __NR_process_madvise 4440 #define __NR_epoll_pwait2 4441 +#define __NR_mount_setattr 4442 diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in index 1be9f3e1..b1b83f5f 100644 --- a/arch/mips64/bits/syscall.h.in +++ b/arch/mips64/bits/syscall.h.in @@ -344,4 +344,5 @@ #define __NR_faccessat2 5439 #define __NR_process_madvise 5440 #define __NR_epoll_pwait2 5441 +#define __NR_mount_setattr 5442 diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in index 1bd7aeb2..bfaa080e 100644 --- a/arch/mipsn32/bits/syscall.h.in +++ b/arch/mipsn32/bits/syscall.h.in @@ -368,4 +368,5 @@ #define __NR_faccessat2 6439 #define __NR_process_madvise 6440 #define __NR_epoll_pwait2 6441 +#define __NR_mount_setattr 6442 diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in index 499aa832..3c60eda9 100644 --- a/arch/or1k/bits/syscall.h.in +++ b/arch/or1k/bits/syscall.h.in @@ -317,4 +317,5 @@ #define __NR_faccessat2 439 #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in index 7f7d5a11..33e26e4b 100644 --- a/arch/powerpc/bits/syscall.h.in +++ b/arch/powerpc/bits/syscall.h.in @@ -421,4 +421,5 @@ #define __NR_faccessat2 439 #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in index b5793172..38bb23cb 100644 --- a/arch/powerpc64/bits/syscall.h.in +++ b/arch/powerpc64/bits/syscall.h.in @@ -393,4 +393,5 @@ #define __NR_faccessat2 439 #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 diff --git a/arch/riscv64/bits/syscall.h.in b/arch/riscv64/bits/syscall.h.in index df6bf5c2..a9cbfb50 100644 --- a/arch/riscv64/bits/syscall.h.in +++ b/arch/riscv64/bits/syscall.h.in @@ -295,6 +295,7 @@ #define __NR_faccessat2 439 #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 #define __NR_sysriscv __NR_arch_specific_syscall #define __NR_riscv_flush_icache (__NR_sysriscv + 15) diff --git a/arch/s390x/bits/syscall.h.in b/arch/s390x/bits/syscall.h.in index 16ec02ee..88de5148 100644 --- a/arch/s390x/bits/syscall.h.in +++ b/arch/s390x/bits/syscall.h.in @@ -358,4 +358,5 @@ #define __NR_faccessat2 439 #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 diff --git a/arch/sh/bits/syscall.h.in b/arch/sh/bits/syscall.h.in index 4fc1f9e8..1a900264 100644 --- a/arch/sh/bits/syscall.h.in +++ b/arch/sh/bits/syscall.h.in @@ -405,4 +405,5 @@ #define __NR_faccessat2 439 #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in index 14c7231f..d90cb157 100644 --- a/arch/x32/bits/syscall.h.in +++ b/arch/x32/bits/syscall.h.in @@ -304,6 +304,7 @@ #define __NR_faccessat2 (0x40000000 + 439) #define __NR_process_madvise (0x40000000 + 440) #define __NR_epoll_pwait2 (0x40000000 + 441) +#define __NR_mount_setattr (0x40000000 + 442) #define __NR_rt_sigaction (0x40000000 + 512) diff --git a/arch/x86_64/bits/syscall.h.in b/arch/x86_64/bits/syscall.h.in index f611884e..634e29fd 100644 --- a/arch/x86_64/bits/syscall.h.in +++ b/arch/x86_64/bits/syscall.h.in @@ -351,4 +351,5 @@ #define __NR_faccessat2 439 #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 -- cgit v1.2.3 From 9ffd145479c53b5eb0940dc6c3d09c060d7f3273 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 25 May 2021 21:16:43 +0000 Subject: s390x: add ptrace requests from linux v5.12 PTRACE_OLDSETOPTIONS is old, but it was missing, PTRACE_SYSEMU and PTRACE_SYSEMU_SINGLESTEP are new, see linux commit 56e62a73702836017564eaacd5212e4d0fa1c01d s390: convert to generic entry --- arch/s390x/bits/ptrace.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/s390x/bits/ptrace.h b/arch/s390x/bits/ptrace.h index d50e3262..a06cb077 100644 --- a/arch/s390x/bits/ptrace.h +++ b/arch/s390x/bits/ptrace.h @@ -1,4 +1,7 @@ #define PTRACE_SINGLEBLOCK 12 +#define PTRACE_OLDSETOPTIONS 21 +#define PTRACE_SYSEMU 31 +#define PTRACE_SYSEMU_SINGLESTEP 32 #define PTRACE_PEEKUSR_AREA 0x5000 #define PTRACE_POKEUSR_AREA 0x5001 #define PTRACE_GET_LAST_BREAK 0x5006 -- cgit v1.2.3 From bc89c311120111de330c99335d3139ff55fae1fe Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 26 May 2021 16:04:38 +0000 Subject: netinet/tcp.h: add TCP_NLA_* values up to linux v5.12 TCP_NLA_EDT was new in v5.9, see linux commit 48040793fa6003d211f021c6ad273477bcd90d91 tcp: add earliest departure time to SCM_TIMESTAMPING_OPT_STATS TCP_NLA_TTL is new in v5.12, see linux commit e7ed11ee945438b737e2ae2370e35591e16ec371 tcp: add TTL to SCM_TIMESTAMPING_OPT_STATS --- include/netinet/tcp.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h index 30f20239..08ed7cc2 100644 --- a/include/netinet/tcp.h +++ b/include/netinet/tcp.h @@ -80,6 +80,8 @@ enum { TCP_NLA_SRTT, TCP_NLA_TIMEOUT_REHASH, TCP_NLA_BYTES_NOTSENT, + TCP_NLA_EDT, + TCP_NLA_TTL, }; #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -- cgit v1.2.3 From 1ee8109ea01c4ac79e7932a533fead96309f80f3 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 26 May 2021 16:01:38 +0000 Subject: netinet/tcp.h: add tcp_zerocopy_receive fields from linux v5.12 see linux commit 7eeba1706eba6def15f6cb2fc7b3c3b9a2651edc tcp: Add receive timestamp support for receive zerocopy. linux commit 3c5a2fd042d0bfac71a2dfb99515723d318df47b tcp: Sanitize CMSG flags and reserved args in tcp_zerocopy_receive. --- include/netinet/tcp.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h index 08ed7cc2..fad1d844 100644 --- a/include/netinet/tcp.h +++ b/include/netinet/tcp.h @@ -294,6 +294,10 @@ struct tcp_zerocopy_receive { uint64_t copybuf_address; int32_t copybuf_len; uint32_t flags; + uint64_t msg_control; + uint64_t msg_controllen; + uint32_t msg_flags; + uint32_t reserved; }; #endif -- cgit v1.2.3 From ee05b11b67d59a6c5bb4b9d661bcc20bbd0bbe7a Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 4 Jul 2021 16:34:15 +0000 Subject: bits/syscall.h: add landlock syscalls from linux v5.13 see linux commit a49f4f81cb48925e8d7cbd9e59068f516e984144 arch: Wire up Landlock syscalls linuxcommit 17ae69aba89dbfa2139b7f8024b757ab3cc42f59 Merge tag 'landlock_v34' of ... jmorris/linux-security Landlock provides for unprivileged application sandboxing. The goal of Landlock is to enable to restrict ambient rights (e.g. global filesystem access) for a set of processes. Landlock is inspired by seccomp-bpf but instead of filtering syscalls and their raw arguments, a Landlock rule can restrict the use of kernel objects like file hierarchies, according to the kernel semantic. --- arch/aarch64/bits/syscall.h.in | 3 +++ arch/arm/bits/syscall.h.in | 3 +++ arch/i386/bits/syscall.h.in | 3 +++ arch/m68k/bits/syscall.h.in | 3 +++ arch/microblaze/bits/syscall.h.in | 3 +++ arch/mips/bits/syscall.h.in | 3 +++ arch/mips64/bits/syscall.h.in | 3 +++ arch/mipsn32/bits/syscall.h.in | 3 +++ arch/or1k/bits/syscall.h.in | 3 +++ arch/powerpc/bits/syscall.h.in | 3 +++ arch/powerpc64/bits/syscall.h.in | 3 +++ arch/riscv64/bits/syscall.h.in | 3 +++ arch/s390x/bits/syscall.h.in | 3 +++ arch/sh/bits/syscall.h.in | 3 +++ arch/x32/bits/syscall.h.in | 3 +++ arch/x86_64/bits/syscall.h.in | 3 +++ 16 files changed, 48 insertions(+) diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in index 037da214..5f420e61 100644 --- a/arch/aarch64/bits/syscall.h.in +++ b/arch/aarch64/bits/syscall.h.in @@ -296,4 +296,7 @@ #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 #define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in index 8919137f..048fdea7 100644 --- a/arch/arm/bits/syscall.h.in +++ b/arch/arm/bits/syscall.h.in @@ -396,6 +396,9 @@ #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 #define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 #define __ARM_NR_breakpoint 0x0f0001 #define __ARM_NR_cacheflush 0x0f0002 diff --git a/arch/i386/bits/syscall.h.in b/arch/i386/bits/syscall.h.in index 4c04ea89..46ffe1d9 100644 --- a/arch/i386/bits/syscall.h.in +++ b/arch/i386/bits/syscall.h.in @@ -433,4 +433,7 @@ #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 #define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/arch/m68k/bits/syscall.h.in b/arch/m68k/bits/syscall.h.in index 136775b4..a0c63323 100644 --- a/arch/m68k/bits/syscall.h.in +++ b/arch/m68k/bits/syscall.h.in @@ -413,3 +413,6 @@ #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 #define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in index 10f27aba..931d7919 100644 --- a/arch/microblaze/bits/syscall.h.in +++ b/arch/microblaze/bits/syscall.h.in @@ -434,4 +434,7 @@ #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 #define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in index 1d0deed3..63e3503a 100644 --- a/arch/mips/bits/syscall.h.in +++ b/arch/mips/bits/syscall.h.in @@ -415,4 +415,7 @@ #define __NR_process_madvise 4440 #define __NR_epoll_pwait2 4441 #define __NR_mount_setattr 4442 +#define __NR_landlock_create_ruleset 4444 +#define __NR_landlock_add_rule 4445 +#define __NR_landlock_restrict_self 4446 diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in index b1b83f5f..b89965d1 100644 --- a/arch/mips64/bits/syscall.h.in +++ b/arch/mips64/bits/syscall.h.in @@ -345,4 +345,7 @@ #define __NR_process_madvise 5440 #define __NR_epoll_pwait2 5441 #define __NR_mount_setattr 5442 +#define __NR_landlock_create_ruleset 5444 +#define __NR_landlock_add_rule 5445 +#define __NR_landlock_restrict_self 5446 diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in index bfaa080e..bb2d04a8 100644 --- a/arch/mipsn32/bits/syscall.h.in +++ b/arch/mipsn32/bits/syscall.h.in @@ -369,4 +369,7 @@ #define __NR_process_madvise 6440 #define __NR_epoll_pwait2 6441 #define __NR_mount_setattr 6442 +#define __NR_landlock_create_ruleset 6444 +#define __NR_landlock_add_rule 6445 +#define __NR_landlock_restrict_self 6446 diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in index 3c60eda9..2b5f2052 100644 --- a/arch/or1k/bits/syscall.h.in +++ b/arch/or1k/bits/syscall.h.in @@ -318,4 +318,7 @@ #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 #define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in index 33e26e4b..b1605a58 100644 --- a/arch/powerpc/bits/syscall.h.in +++ b/arch/powerpc/bits/syscall.h.in @@ -422,4 +422,7 @@ #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 #define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in index 38bb23cb..b3a8fba0 100644 --- a/arch/powerpc64/bits/syscall.h.in +++ b/arch/powerpc64/bits/syscall.h.in @@ -394,4 +394,7 @@ #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 #define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/arch/riscv64/bits/syscall.h.in b/arch/riscv64/bits/syscall.h.in index a9cbfb50..b534afe8 100644 --- a/arch/riscv64/bits/syscall.h.in +++ b/arch/riscv64/bits/syscall.h.in @@ -296,6 +296,9 @@ #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 #define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 #define __NR_sysriscv __NR_arch_specific_syscall #define __NR_riscv_flush_icache (__NR_sysriscv + 15) diff --git a/arch/s390x/bits/syscall.h.in b/arch/s390x/bits/syscall.h.in index 88de5148..dfc38479 100644 --- a/arch/s390x/bits/syscall.h.in +++ b/arch/s390x/bits/syscall.h.in @@ -359,4 +359,7 @@ #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 #define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/arch/sh/bits/syscall.h.in b/arch/sh/bits/syscall.h.in index 1a900264..ff14f54d 100644 --- a/arch/sh/bits/syscall.h.in +++ b/arch/sh/bits/syscall.h.in @@ -406,4 +406,7 @@ #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 #define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in index d90cb157..5d22fa17 100644 --- a/arch/x32/bits/syscall.h.in +++ b/arch/x32/bits/syscall.h.in @@ -305,6 +305,9 @@ #define __NR_process_madvise (0x40000000 + 440) #define __NR_epoll_pwait2 (0x40000000 + 441) #define __NR_mount_setattr (0x40000000 + 442) +#define __NR_landlock_create_ruleset (0x40000000 + 444) +#define __NR_landlock_add_rule (0x40000000 + 445) +#define __NR_landlock_restrict_self (0x40000000 + 446) #define __NR_rt_sigaction (0x40000000 + 512) diff --git a/arch/x86_64/bits/syscall.h.in b/arch/x86_64/bits/syscall.h.in index 634e29fd..c3882de7 100644 --- a/arch/x86_64/bits/syscall.h.in +++ b/arch/x86_64/bits/syscall.h.in @@ -352,4 +352,7 @@ #define __NR_process_madvise 440 #define __NR_epoll_pwait2 441 #define __NR_mount_setattr 442 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 -- cgit v1.2.3 From dda21f10a7d800812cdc63602556c2d217de1d3c Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 4 Jul 2021 20:33:25 +0000 Subject: netinet/in.h: add INADDR_DUMMY from linux v5.13 see linux commit 321827477360934dc040e9d3c626bf1de6c3ab3c icmp: don't send out ICMP messages with a source address of 0.0.0.0 "RFC7600 reserves a dummy address to be used as a source for ICMP messages (192.0.0.8/32), so let's teach the kernel to substitute that address as a last resort if the regular source address selection procedure fails." --- include/netinet/in.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/netinet/in.h b/include/netinet/in.h index f9594339..fb628b61 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -48,6 +48,7 @@ struct ipv6_mreq { #define INADDR_BROADCAST ((in_addr_t) 0xffffffff) #define INADDR_NONE ((in_addr_t) 0xffffffff) #define INADDR_LOOPBACK ((in_addr_t) 0x7f000001) +#define INADDR_DUMMY ((in_addr_t) 0xc0000008) #define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000) #define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001) -- cgit v1.2.3 From a8300f5d2a4b0774a1646454bdf6c629d2c49ace Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 7 Jul 2021 17:40:46 +0000 Subject: elf.h: add NT_ARM_PAC_ENABLED_KEYS from linux v5.13 see linux commit 201698626fbca1cf1a3b686ba14cf2a056500716 arm64: Introduce prctl(PR_PAC_{SET,GET}_ENABLED_KEYS) --- include/elf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/elf.h b/include/elf.h index 5170f3e2..86e2f0bb 100644 --- a/include/elf.h +++ b/include/elf.h @@ -687,6 +687,7 @@ typedef struct { #define NT_ARM_PACA_KEYS 0x407 #define NT_ARM_PACG_KEYS 0x408 #define NT_ARM_TAGGED_ADDR_CTRL 0x409 +#define NT_ARM_PAC_ENABLED_KEYS 0x40a #define NT_METAG_CBUF 0x500 #define NT_METAG_RPIPE 0x501 #define NT_METAG_TLS 0x502 -- cgit v1.2.3 From aa3bab6ce48d4e210ba3a86fed62e589df789ff4 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 7 Jul 2021 17:43:30 +0000 Subject: sys/prctl.h: add PR_PAC_{SET,GET}_ENABLED_KEYS from linux v5.13 see linux commit 201698626fbca1cf1a3b686ba14cf2a056500716 arm64: Introduce prctl(PR_PAC_{SET,GET}_ENABLED_KEYS) --- include/sys/prctl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/sys/prctl.h b/include/sys/prctl.h index 3f0254c7..087a75c9 100644 --- a/include/sys/prctl.h +++ b/include/sys/prctl.h @@ -174,6 +174,9 @@ struct prctl_mm_map { #define SYSCALL_DISPATCH_FILTER_ALLOW 0 #define SYSCALL_DISPATCH_FILTER_BLOCK 1 +#define PR_PAC_SET_ENABLED_KEYS 60 +#define PR_PAC_GET_ENABLED_KEYS 61 + int prctl (int, ...); #ifdef __cplusplus -- cgit v1.2.3 From bdb5454065f74b0f6b5ddd8ee39f83d6303c97bb Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 7 Jul 2021 17:46:31 +0000 Subject: sys/ptrace.h: add PTRACE_GET_RSEQ_CONFIGURATION from linux v5.13 see linux commit 90f093fa8ea48e5d991332cee160b761423d55c1 rseq, ptrace: Add PTRACE_GET_RSEQ_CONFIGURATION request the struct type got __ prefix to follow existing practice. --- include/sys/ptrace.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/sys/ptrace.h b/include/sys/ptrace.h index 5d62a985..c72e3c06 100644 --- a/include/sys/ptrace.h +++ b/include/sys/ptrace.h @@ -42,6 +42,7 @@ extern "C" { #define PTRACE_SECCOMP_GET_FILTER 0x420c #define PTRACE_SECCOMP_GET_METADATA 0x420d #define PTRACE_GET_SYSCALL_INFO 0x420e +#define PTRACE_GET_RSEQ_CONFIGURATION 0x420f #define PT_READ_I PTRACE_PEEKTEXT #define PT_READ_D PTRACE_PEEKDATA @@ -130,6 +131,14 @@ struct __ptrace_syscall_info { }; }; +struct __ptrace_rseq_configuration { + uint64_t rseq_abi_pointer; + uint32_t rseq_abi_size; + uint32_t signature; + uint32_t flags; + uint32_t pad; +}; + long ptrace(int, ...); #ifdef __cplusplus -- cgit v1.2.3 From 760f5d7efed4d4761875334f8c4e6398be308cc9 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 8 Mar 2022 17:21:49 -0500 Subject: fix __WORDSIZE on x32 sys/user.h sys/reg.h already had it right as 32, to which it was explicitly changed when commit 664cd341921007cea52c8891f27ce35927dca378 derived x32 from x86_64. but the copy exposed in sys/user.h was missed. --- arch/x32/bits/user.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x32/bits/user.h b/arch/x32/bits/user.h index 4073cc06..eac82a14 100644 --- a/arch/x32/bits/user.h +++ b/arch/x32/bits/user.h @@ -1,5 +1,5 @@ #undef __WORDSIZE -#define __WORDSIZE 64 +#define __WORDSIZE 32 typedef struct user_fpregs_struct { uint16_t cwd, swd, ftw, fop; -- cgit v1.2.3 From 6d8a515796270eb6cec8a278cb353a078a10f09a Mon Sep 17 00:00:00 2001 From: Isaiah Poston Date: Sat, 12 Mar 2022 18:21:56 -0600 Subject: fix invalid free of duplocale object when malloc has been replaced newlocale and freelocale use __libc_malloc and __libc_free, but duplocale used malloc. If malloc was replaced, this resulted in invalid free using the wrong allocator when passing the result of duplocale to freelocale. Instead, use libc-internal malloc for duplocale. This bug was introduced by commit 1e4204d522670a1d8b8ab85f1cfefa960547e8af. --- src/locale/duplocale.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/locale/duplocale.c b/src/locale/duplocale.c index 030b64cb..5ce33ae6 100644 --- a/src/locale/duplocale.c +++ b/src/locale/duplocale.c @@ -3,6 +3,11 @@ #include "locale_impl.h" #include "libc.h" +#define malloc __libc_malloc +#define calloc undef +#define realloc undef +#define free undef + locale_t __duplocale(locale_t old) { locale_t new = malloc(sizeof *new); -- cgit v1.2.3 From 01b14242cccb03c411d3eb1437c99da663c95507 Mon Sep 17 00:00:00 2001 From: psykose Date: Wed, 2 Mar 2022 21:16:54 +0100 Subject: accept null pointer as message argument to gettext functions the change to support passing null was rejected in the past on the grounds that GNU gettext documented it as undefined, on an assumption that only glibc accepted it and that the standalone GNU gettext did not. but it turned out that both explicitly accept it. in light of this, since some software assumes null can be passed safely, allow it. --- src/locale/dcngettext.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/locale/dcngettext.c b/src/locale/dcngettext.c index d1e6c6d1..0b53286d 100644 --- a/src/locale/dcngettext.c +++ b/src/locale/dcngettext.c @@ -132,6 +132,9 @@ char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2, struct binding *q; int old_errno = errno; + /* match gnu gettext behaviour */ + if (!msgid1) goto notrans; + if ((unsigned)category >= LC_ALL) goto notrans; if (!domainname) domainname = __gettextdomain(); -- cgit v1.2.3 From 7a43f6fea9081bdd53d8a11cef9e9fab0348c53d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 7 Apr 2022 13:12:40 -0400 Subject: release 1.2.3 --- VERSION | 2 +- WHATSNEW | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 23aa8390..0495c4a8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.2 +1.2.3 diff --git a/WHATSNEW b/WHATSNEW index e1d01982..f9bb2482 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -2287,3 +2287,43 @@ arch-specific bugs fixed: - i386 __set_thread_area fallback for pre-2.6 kernels didn't work - missing O_LARGEFILE macro value on x86_64, x32, mips64 - unpredictable s390x breakage from failure to preserve call-saved registers + + + +1.2.3 release notes + +new features: +- qsort_r function (POSIX-future) +- pthread_getname_np extension function +- hard float on SPE FPU for powerpc-sf +- SEEK_DATA and SEEK_HOLE exposed in unistd.h (Linux extensions) + +compatibility: +- free now preserves errno (POSIX-future requirement) +- setjmp is declared explicitly with returns_twice for non-GCC compilers +- macro version of isascii is no longer defined for C++ +- dynamic linker now tolerates zero-length LOAD segments +- epoll_[p]wait is now a cancellation point +- pwd/grp functions no longer fail on systems without AF_UNIX support +- POSIX TZ parsing is stricter to allow more names to fallback to files +- NULL is now defined as nullptr when used in C++11 or later +- gettext now accepts null pointer as argument + +bugs fixed: +- old regression in wcwidth of Hangul combining (vowel/final) letters +- duplocale used wrong malloc when malloc was replaced (1.2.2 regression) +- fmaf rounded wrong on archs without FE_TOWARDZERO (all softfloat archs) +- popen didn't honor requirement not to leak other popen pipe fds to child +- aligned_alloc and variants crashed on allocation failure +- dl_iterate_phdr reported incorrect module TLS pointers +- mishandling of some inputs in acoshf and expm1f and functions using them +- potentially wrong-sign zero in cproj functions at infinity +- multiple bugs in legacy function cuserid +- minor posix_spawn file actions API conformance issues +- pthread_setname_np fd leak +- out-of-bound read in zoneinfo handling with distant-past times +- out-of-tree builds lacked generated debug cfi for x86 asm + +arch-specific bugs fixed: +- powerpc (32-bit) struct shmid_ds layout was wrong for some fields +- time64 struct layout was wrong in sound ioctl fallback (32-bit archs) -- cgit v1.2.3 From 782759fa98d1e04a7a934c5304312e89148a1ea3 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 15 Apr 2022 14:54:45 -0700 Subject: Disable stack protector and stack variable initialization for crt objects Most of the crt objects are simple enough that stack protection and stack variable initialization don't occur, but rcrt1.c needs them disabled. rcrt1.o wasn't previously used, but the rustc build uses it. Disable stack protector and stack variable initialization for all crt objects to future proof them. Bug: 216192129 Test: rustc builds Change-Id: Icec48575890d897390c7705eeeb3e1cf29232324 --- Android.bp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Android.bp b/Android.bp index 2404954b..4dcff0c4 100644 --- a/Android.bp +++ b/Android.bp @@ -389,10 +389,21 @@ cc_genrule { // The musl CRT objects // +cc_defaults { + name: "libc_musl_crt_defaults", + defaults: ["libc_musl_defaults"], + cflags: [ + // These are required to make sure the C code in crt/*.c + // doesn't have any dependencies on libc. + "-fno-stack-protector", + "-ftrivial-auto-var-init=uninitialized", + ], +} + cc_object { name: "libc_musl_crt1", defaults: [ - "libc_musl_defaults", + "libc_musl_crt_defaults", "libc_musl_crt1_sources", ], } @@ -400,7 +411,7 @@ cc_object { cc_object { name: "libc_musl_crti", defaults: [ - "libc_musl_defaults", + "libc_musl_crt_defaults", "libc_musl_crti_sources", ], } @@ -408,7 +419,7 @@ cc_object { cc_object { name: "libc_musl_crtn", defaults: [ - "libc_musl_defaults", + "libc_musl_crt_defaults", "libc_musl_crtn_sources", ], } @@ -416,7 +427,7 @@ cc_object { cc_object { name: "libc_musl_rcrt1", defaults: [ - "libc_musl_defaults", + "libc_musl_crt_defaults", "libc_musl_rcrt1_sources", ], } @@ -424,7 +435,7 @@ cc_object { cc_object { name: "libc_musl_Scrt1", defaults: [ - "libc_musl_defaults", + "libc_musl_crt_defaults", "libc_musl_Scrt1_sources", ], } -- cgit v1.2.3 From 76db0349757e79ab0c702c73a171bea684bc5824 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 15 Apr 2022 15:17:41 -0700 Subject: Add more files to the musl sysroot for rustc builds Add libc++.a and the clang crtbegin and crtend objects to the musl sysroot to allow building rustc against it. The crtbegin and crtend objects are also copied to all the different names gcc uses, as clang uses the same object for all build types. Bug: 216192129 Test: rustc builds Change-Id: I681f90ee381405be50f32763d85e1f486fff142a --- Android.bp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Android.bp b/Android.bp index 4dcff0c4..d6d7c642 100644 --- a/Android.bp +++ b/Android.bp @@ -723,6 +723,7 @@ cc_genrule { ":libc_musl_static", ":libc++abi", ":libc++", + ":libc++_static", // Objects ":libc_musl_crti", @@ -730,6 +731,8 @@ cc_genrule { ":libc_musl_crt1", ":libc_musl_rcrt1", ":libc_musl_Scrt1", + ":clang_rt.crtbegin", + ":clang_rt.crtend", // Embedded linker objects and linker scripts ":libc_musl_linker_object", @@ -796,10 +799,14 @@ cc_genrule { " -f $(location :libc_musl_sysroot_static_empty) " + " -f $(genDir)/Scrt1.ld " + " -f $(location :libc_musl_Scrt1) " + + " -f $(location :libc++_static) " + + " -f $(location :clang_rt.crtbegin) " + + " -f $(location :clang_rt.crtend) " + " && " + "$(location zip2zip) -i $(genDir)/libs.zip -o $(genDir)/libs_renamed.zip " + // rename libs from module names to desired names in sysroot " lib/libc_musl_static.a:lib/libc.a " + + " lib/libc++_static.a:lib/libc++.a " + // Swap in linker script for Scrt1.o " lib/Scrt1.o:lib/Scrt1-real.o " + " lib/Scrt1.ld:lib/Scrt1.o " + @@ -812,6 +819,12 @@ cc_genrule { " lib/libc_musl_sysroot_static_empty.a:lib/librt.a " + " lib/libc_musl_sysroot_static_empty.a:lib/libutil.a " + " lib/libc_musl_sysroot_static_empty.a:lib/libxnet.a " + + // rename clang crt objects to gcc names + " lib/clang_rt.crtbegin.o:lib/crtbegin.o " + + " lib/clang_rt.crtbegin.o:lib/crtbeginS.o " + + " lib/clang_rt.crtbegin.o:lib/crtbeginT.o " + + " lib/clang_rt.crtend.o:lib/crtend.o " + + " lib/clang_rt.crtend.o:lib/crtendS.o " + " && " + "$(location merge_zips) -ignore-duplicates $(out) " + " $(location :libc_musl_sysroot_bionic_headers) " + -- cgit v1.2.3