From patchwork Tue Jan 9 10:24:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 25283 Received: (qmail 68429 invoked by alias); 9 Jan 2018 10:25:16 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 68418 invoked by uid 89); 9 Jan 2018 10:25:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-ClientProxiedBy:206 X-HELO: EUR03-AM5-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; Message-ID: <5A54987B.6040305@arm.com> Date: Tue, 09 Jan 2018 10:24:59 +0000 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: GNU C Library CC: nd@arm.com, Carlos O'Donell Subject: [PATCH v3] aarch64: enforce >=64K guard size X-ClientProxiedBy: AM5PR06CA0028.eurprd06.prod.outlook.com (2603:10a6:206:2::41) To DB6PR0802MB2486.eurprd08.prod.outlook.com (2603:10a6:4:a0::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: bc3ee4b8-479c-44d0-7284-08d5574b3e21 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(49563074)(7193020); SRVR:DB6PR0802MB2486; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2486; 3:hccsi7/2o4oiIOOTzKY4BizAuW+aloA12lMzqmbjxYTry9mqi/HNY7lNKl5UjpBW0wyDv6C/KJtAG3nBFl+9QI0hADnV+MaAM89qvfNQshA1la7Uy/Dig9ZtNTTV5Q9XL7Cg7PUkMmPvkNHcrqL5euv1MMv0pabTQZC6wDVMd1CHN0zTCgsZQidtXMB/NhhZqEm0GaUU4ZPS6oEJIOLJFcRQASGtKSeHeInx6++JqcAPELu/SA6vGEiKm1+/tRZF; 25:gnLo/KspEYyYhBtiYjx5uu61FIYNs5kdqd84VUq9Rb0qfNIux0NbEJisehcbTdLWjDwEn9ig9djWqBTUe/sTdtOVwCRl6YOWXRMBjxyGkTmlD3TZMiPfZ0Req10yN2MkqXsFw3x9FyH1uHrv4yYJr/9wpYFu0vVvpkXjihh7ligUq0CMY6luQRhJkRtDwMQKAnVnRmgGNT1wpmMiIsleUqKnpO6WS4F9Qb36eNhERVAZ7NY9adoywl5wBRws8sOtGWTivraeBhhaa89L+8dU7A0av88ZFzJ5o3GDWCKkAj/mp3WRfLniWc1T/rxF4Bo+8Rxs3J6I9xtEDUQKXw6otw==; 31:N4LaMUSE/krDtE+tNW/EW5VxhUvqsztfPZRHFxmiC0zNf3WYS5QojVMS26/rOlaAxYKIiSYHpU1wpe6EBvxHick8vqk/7q5kFAp/Tgy7hWA/zUwLB+6YUDdR7Wr/jB3jlIXIKly6Jq8gDnXqd5rt0tSR8AZeCDqhXH/huLleBT+jdOha5vD7A19PPXApsGfoFZsJjizTfu/RNVO+Oqg9cpBhtqlh4bkCqZJQ81S/LrA= X-MS-TrafficTypeDiagnostic: DB6PR0802MB2486: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2486; 20:UVTQZTeGP51TzJ0QWn1merT6qaP09kskSPuRCpL1/Pf1e2FRfsTl3PIzOxPRPRQFMNiHU+nGhW3Q+OBX2CC6nx1npaCIDvIUVhiD33vq0rbRG5woc+8DkyQsr+IUI8m3z64UpCp/QyKKezFxrpSPyedj83sD31GK1UTV0tEZI8Y=; 4:p1LLnbvK668+pBgcnBRlNkOIrnPXZwRUr5Mfry7s/oS3OTfRNZGBf7akxUNtHaw/IQ3MfmUbgGNYk9JCDq7F7a6D5XdBOv/LSAq9JvbhoiTYj70E5tFB04DhIhKhP6c6Co9L0/J7KFKyJ3w6uifPwieGB1SvRo0DymA1TKh1AFHM/hu0sFzvfvpMVpZGPMdLgFa0wq7mFbbYBi5JbTq1jWjmDAeUjDRYpDdvA9uc82kYFe7Qf5xH18X6/3LMnhr+je7XVXzZH6iKv+IK2v/xs45hJczTRKwOtmzSJ7Wc1B6q0HsHW3UqBvbxFBNRAvuq X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415395)(6040470)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231023)(944501075)(10201501046)(6055026)(6041268)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB6PR0802MB2486; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DB6PR0802MB2486; X-Forefront-PRVS: 0547116B72 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(39860400002)(346002)(396003)(39380400002)(376002)(366004)(189003)(199004)(377424004)(53936002)(83506002)(6486002)(72206003)(97736004)(80316001)(478600001)(77096006)(16586007)(5890100001)(8676002)(64126003)(16576012)(16526018)(316002)(81166006)(8936002)(58126008)(81156014)(68736007)(4610100001)(65956001)(270700001)(568964002)(4326008)(84326002)(25786009)(59896002)(65806001)(7736002)(106356001)(33656002)(3846002)(6116002)(21490400003)(59450400001)(36756003)(66066001)(5660300001)(6916009)(2906002)(2476003)(65816011)(305945005)(52116002)(33964004)(386003)(105586002)(87266011)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2486; H:[10.2.206.69]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0802MB2486; 23:hfYWGYtOErGU6zSH/3QS36cOr5/SEQ9G53XP6mu?= =?us-ascii?Q?gfLS7UmkCTO/WmUgfvjMi1kypgnO/9oyvDMM+oYM26BeOGftxWKRjca6TytV?= =?us-ascii?Q?TXjrwzFeCcwSMJ9L9BYVq3AbPRunnzQ3RfKrTpIYb3zABMUJ9hRVeuEBaiIa?= =?us-ascii?Q?EHv407DBmriXI1OaUJ6neAoV/RztPNRjInvfDqTt6rb5vfMHOgIEyjM/nxyE?= =?us-ascii?Q?FCkugJAdroWLOpxUvi6BZIlACbaDOjqWMDEDAKJUBojIfR6sIAmzUWw5FLTK?= =?us-ascii?Q?oiPAruzBuwqzgPOjQzW9Nk/xlwkGMiFEeoUK55fJq/DlF7SSCrXPy6+YZIIk?= =?us-ascii?Q?O2QYG5hDGVImnftBSoHTRs/rZuguVhAHU79zxoS7/O/EOwjgIgRNvrHyFAhk?= =?us-ascii?Q?g4qvDweDRmFUizbH8jcyfgjJZsBBfrzHB65mENNmF/ys+vEs18znkzZq+Q5C?= =?us-ascii?Q?LrY0BDErfo24u437IVWol/pPP5asIMCSGzmnkTvOEAqzl64RMqK3uwGsgOh3?= =?us-ascii?Q?C651j+WYMfGj2hJ/u7wMNfig/cQFTN/VCAdodi7RMRrcpKB4ib4YpKS7dzWe?= =?us-ascii?Q?OeGXWVuCh6nAV19CmFwtXvgCjPFeqdmJ1UviZ9xejs+qsuRX5SU2c7e10Gv/?= =?us-ascii?Q?0a9tl8ProoAOl60Rp86D5UrC+RX0FCQPtuwogQF7xpsUV52nqKHXSVp9blnw?= =?us-ascii?Q?o+E3qiGMzY4xfMER7AomV4YKbObfPKT83LiHAO/olznZYBcHws9NRlqxWOxR?= =?us-ascii?Q?DLvL+6EdMPr3yJjQOi1gkpwlCb5fmz9v9W8EUC9o/cLX2YEI1VJbIOEzRBQk?= =?us-ascii?Q?+8iB0khVb5cLbfkXGZRhfrkiLmVoxvy2ctsUatShbGBX7a0amWC8vNztA+Ty?= =?us-ascii?Q?axmZ3LMExwkX7UmrehGCKqJ9sUdSwHtwUrH/Vmrw9mHMF8vjFVdU4s1WEmsE?= =?us-ascii?Q?EeR38dNxBnLzknTWjbWxHHBMPv3vEo66f3DL78eRC1arrjVL7dlrFHIZMsVz?= =?us-ascii?Q?/Xu8fQxb36KCxYhcw/2sxItBW7aBgK4QMg42e0MXvZfPGRtIZo7O12j0bSEq?= =?us-ascii?Q?Yr2WTDCDPa2t4/FUzS2uZchNwCsMbGmLnumMTuTyUXBtcNDOW6rmsPvdVvCR?= =?us-ascii?Q?P0tw8QyeqMnpfoxcSOH5UNwQwv0CNUJZd936mfz/ZDJHVMW/3SI64Xr1lwML?= =?us-ascii?Q?45g6gOt4v5LPEg/z40f84pCDUDc4AbPR6q/4PspU1EyT+wYTDpiRnpSU1zuq?= =?us-ascii?Q?M6wzYbrcy/Hz/fL79lxppwWRRTbkZPiHgf7rJe1jv9BkJMGbsb02H67vu9b3?= =?us-ascii?Q?TWEZPdXSC6RM/wYV1WTarNwJ2VEghLjv6dS7Wf+ohmBDn90cLMEhnfw4qKLk?= =?us-ascii?Q?ocRf86c1MnVICgyI9PnTM4Xf4OtP7yS7rUQ367tZm4GA4DwaJ?= X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2486; 6:8LVFPsQzTp0wAqiNfftaDKqG9/OmINQjQmDeVuRSrVs4fr+cRBz6OE4M5I+pA39A9iH7Uzwy3ocuX4lISukEb/3AbBgDqDbg5Fn6PqWk2s5zwL9jmoMvMdAmqB2jwEdB4B74ijPa1zO4CKh9AlI0UaCrWvb4OUAyJzNTj2eOVZ6WQjfGCspar88w1t+miOrKMyrfeai3q/I8LqPV+J1J0s7UCakBMT545eoaWVee3XkRcV3WpsxABGGUfqtdYUjBNq96/0DPuSypPNp604dlv/qFP/+G4c6+WA9zywiBMC75E5DYR1g/vuy068Z4ndTqmTiei5DUhMZaz8wAIWB2SwAfgpy5XsUl8vSV1AmUepg=; 5:kOuAspOY+QwoYCyDgiLKCUnpi5d4rZrKSskdy2PjvHzlWpI6tlTXTRnYGMB//YMDcNkqCkFBWeEd8VnqaaumeAXmC8bbrRKKHW3G0Ra/OxYCqmZp3PeYXu2EKvOCXR/WrDdtJ1vUhh0T9wqO39uXwqQ4q6o52Kx5wGyu42R02fU=; 24:BflxeqJpfXdEGsLfKolO0oAOeK9nbV9GfFa0azW6bMibaNikPd6OZI2TIJzJNiNt96nHsS5MhTMgssHslIsIgsVieUulGKTv6hjGxz79gUY=; 7:z6GF7aA1KD181iTtPIE+Th7zZqy4TEoycjnH/Jb8gxSZBYd4VPzZnySVsskvWA7MX/07HOmDTBL9C6RfJInl6ZVavquHy+pFxueURwQ+dzrScFpylZHRz+gYZ4xFAQtU5d0LmhDDanIbZTtDr0SlPXB2/O156PBql45ThwwzP9VwLiGEbbyFNzoxno8bMx+Iv2BejS//PE6cFoCZQZEQZC3aiW/U90Ir5PB4tN66KrYfDv16cjwv5ydS5ZLnc5oo SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 10:25:01.6523 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc3ee4b8-479c-44d0-7284-08d5574b3e21 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2486 v3: - more comment in allocate_stack. - define ARCH_MIN_GUARD_SIZE explicitly for all targets. - rebase on top of master. v2: - only change guard size on aarch64 - don't report the inflated guard size There are several compiler implementations that allow large stack allocations to jump over the guard page at the end of the stack and corrupt memory beyond that. See CVE-2017-1000364. Compilers can emit code to probe the stack such that the guard page cannot be skipped, but on aarch64 the probe interval is 64K instead of the minimum supported page size (4K). This patch enforces at least 64K guard on aarch64 unless the guard is disabled by its size to 0. For backward compatibility reasons the increased guard is not reported, so it is only observable by exhausting the address space or parsing /proc/self/maps on linux. On other targets the patch has no effect. The patch does not affect threads with user allocated stacks. 2018-01-09 Szabolcs Nagy * nptl/allocatestack.c (allocate_stack): Use ARCH_MIN_GUARD_SIZE. * sysdeps/aarch64/nptl/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/alpha/nptl/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/arm/nptl/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/hppa/nptl/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/i386/nptl/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/ia64/nptl/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/m68k/nptl/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/microblaze/nptl/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/mips/nptl/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/nios2/nptl/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/powerpc/nptl/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/s390/nptl/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/sh/nptl/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/sparc/sparc32/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/sparc/sparc64/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/tile/nptl/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. * sysdeps/x86_64/nptl/pthreaddef.h (ARCH_MIN_GUARD_SIZE): Define. diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index b374f4794d0614ebc3af89edd857b798b7d9c6fd..39b9098a0921f2eef573dcdca016d2ea296bbef1 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -520,6 +520,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, { /* Allocate some anonymous memory. If possible use the cache. */ size_t guardsize; + size_t reported_guardsize; size_t reqsize; void *mem; const int prot = (PROT_READ | PROT_WRITE @@ -530,8 +531,17 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, assert (size != 0); /* Make sure the size of the stack is enough for the guard and - eventually the thread descriptor. */ + eventually the thread descriptor. On some targets there is + a minimum guard size requirement, ARCH_MIN_GUARD_SIZE, so + internally enforce it (unless the guard was disabled), but + report the original guard size for backward compatibility: + before POSIX 2008 the guardsize was specified to be one page + by default which is observable via pthread_attr_getguardsize + and pthread_getattr_np. */ guardsize = (attr->guardsize + pagesize_m1) & ~pagesize_m1; + reported_guardsize = guardsize; + if (guardsize > 0 && guardsize < ARCH_MIN_GUARD_SIZE) + guardsize = ARCH_MIN_GUARD_SIZE; if (guardsize < attr->guardsize || size + guardsize < guardsize) /* Arithmetic overflow. */ return EINVAL; @@ -743,7 +753,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, /* The pthread_getattr_np() calls need to get passed the size requested in the attribute, regardless of how large the actually used guardsize is. */ - pd->reported_guardsize = guardsize; + pd->reported_guardsize = reported_guardsize; } /* Initialize the lock. We have to do this unconditionally since the diff --git a/sysdeps/aarch64/nptl/pthreaddef.h b/sysdeps/aarch64/nptl/pthreaddef.h index 32f729ada1d96054c9158c9fe165f60ecc967caf..da2c5de3172d0ccf4503c23368f7f85ee5a6de2c 100644 --- a/sysdeps/aarch64/nptl/pthreaddef.h +++ b/sysdeps/aarch64/nptl/pthreaddef.h @@ -19,6 +19,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE (64 * 1024) + /* Required stack pointer alignment at beginning. */ #define STACK_ALIGN 16 diff --git a/sysdeps/alpha/nptl/pthreaddef.h b/sysdeps/alpha/nptl/pthreaddef.h index f5055836005ac220c961bfcc1749bc39d1e65270..c0ad663f1c3612f3655bccf987adfda5dc591eca 100644 --- a/sysdeps/alpha/nptl/pthreaddef.h +++ b/sysdeps/alpha/nptl/pthreaddef.h @@ -18,6 +18,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (4 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* Required stack pointer alignment at beginning. The ABI requires 16. */ #define STACK_ALIGN 16 diff --git a/sysdeps/arm/nptl/pthreaddef.h b/sysdeps/arm/nptl/pthreaddef.h index f8d821d6f2800660b45153019c1f0e04475e0da1..22d128d75f182f524ef625da6121983bab86bc10 100644 --- a/sysdeps/arm/nptl/pthreaddef.h +++ b/sysdeps/arm/nptl/pthreaddef.h @@ -18,6 +18,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* Required stack pointer alignment at beginning. SSE requires 16 bytes. */ #define STACK_ALIGN 16 diff --git a/sysdeps/hppa/nptl/pthreaddef.h b/sysdeps/hppa/nptl/pthreaddef.h index cdb55687f531e83324a149daeeb461857cf89e4a..251513f60a353a55962054a2212985bd975a23fd 100644 --- a/sysdeps/hppa/nptl/pthreaddef.h +++ b/sysdeps/hppa/nptl/pthreaddef.h @@ -18,6 +18,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (8 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* Required stack pointer alignment at beginning. */ #define STACK_ALIGN 64 diff --git a/sysdeps/i386/nptl/pthreaddef.h b/sysdeps/i386/nptl/pthreaddef.h index deacd92edf2cea0540add4a4bcf44b487cf03abc..51e098dbcd83f271ca903673aad7e4afc36e1fce 100644 --- a/sysdeps/i386/nptl/pthreaddef.h +++ b/sysdeps/i386/nptl/pthreaddef.h @@ -19,6 +19,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* Required stack pointer alignment at beginning. SSE requires 16 bytes. */ #define STACK_ALIGN 16 diff --git a/sysdeps/ia64/nptl/pthreaddef.h b/sysdeps/ia64/nptl/pthreaddef.h index 09f9acf25c1a893e4a62f03dbaf61a75f3e768f0..2c5a2da3737008eb99b1d6ca616a6c971292aa8e 100644 --- a/sysdeps/ia64/nptl/pthreaddef.h +++ b/sysdeps/ia64/nptl/pthreaddef.h @@ -18,6 +18,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (32 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* IA-64 uses a normal stack and a register stack. */ #define NEED_SEPARATE_REGISTER_STACK diff --git a/sysdeps/m68k/nptl/pthreaddef.h b/sysdeps/m68k/nptl/pthreaddef.h index 68fc37a394f8c2c5da85852afde608958230a965..84092356e49a0eef487a12d5aa6e55109e991d23 100644 --- a/sysdeps/m68k/nptl/pthreaddef.h +++ b/sysdeps/m68k/nptl/pthreaddef.h @@ -19,6 +19,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* Required stack pointer alignment at beginning. */ #define STACK_ALIGN 16 diff --git a/sysdeps/microblaze/nptl/pthreaddef.h b/sysdeps/microblaze/nptl/pthreaddef.h index 12fac81398e74949740b2d47cfeb5030e76ec229..377f751b5e13dd5ab5f011ec09a7a155c9562588 100644 --- a/sysdeps/microblaze/nptl/pthreaddef.h +++ b/sysdeps/microblaze/nptl/pthreaddef.h @@ -22,6 +22,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* Required stack pointer alignment at beginning. */ #define STACK_ALIGN 16 diff --git a/sysdeps/mips/nptl/pthreaddef.h b/sysdeps/mips/nptl/pthreaddef.h index 7b1283ae64b1d3b99ad6cf7a3db0331a3b919414..936e5175935c6343840181b122891a9a4c4414e4 100644 --- a/sysdeps/mips/nptl/pthreaddef.h +++ b/sysdeps/mips/nptl/pthreaddef.h @@ -18,6 +18,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* Required stack pointer alignment at beginning. */ #define STACK_ALIGN 16 diff --git a/sysdeps/nios2/nptl/pthreaddef.h b/sysdeps/nios2/nptl/pthreaddef.h index b70d1d17b3393ad77563048c2ddc16f8c065f617..34862beebffbc0e113efc407402cdbcda70fac6a 100644 --- a/sysdeps/nios2/nptl/pthreaddef.h +++ b/sysdeps/nios2/nptl/pthreaddef.h @@ -19,6 +19,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* Required stack pointer alignment at beginning. */ #define STACK_ALIGN 4 diff --git a/sysdeps/powerpc/nptl/pthreaddef.h b/sysdeps/powerpc/nptl/pthreaddef.h index 83416849eefd55d04a12a6d4c87a2137f180643b..e7f0617d516556c4425361c2d3b3680372df83a7 100644 --- a/sysdeps/powerpc/nptl/pthreaddef.h +++ b/sysdeps/powerpc/nptl/pthreaddef.h @@ -18,6 +18,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (4 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* Required stack pointer alignment at beginning. The ABI requires 16 bytes (for both 32-bit and 64-bit PowerPC). */ #define STACK_ALIGN 16 diff --git a/sysdeps/s390/nptl/pthreaddef.h b/sysdeps/s390/nptl/pthreaddef.h index 410ae7b8962f8bdb44bc13d42ff771d6289cc829..7aa0fc76179d04e5c531f617f6971fdc9696fa8d 100644 --- a/sysdeps/s390/nptl/pthreaddef.h +++ b/sysdeps/s390/nptl/pthreaddef.h @@ -18,6 +18,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* Required stack pointer alignment at beginning. SSE requires 16 bytes. */ #define STACK_ALIGN 16 diff --git a/sysdeps/sh/nptl/pthreaddef.h b/sysdeps/sh/nptl/pthreaddef.h index 97c7e07100430ade57c455717ad572456f86805b..8a295a991c3a5f52698409246ddd53efcd333eea 100644 --- a/sysdeps/sh/nptl/pthreaddef.h +++ b/sysdeps/sh/nptl/pthreaddef.h @@ -20,6 +20,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* Required stack pointer alignment at beginning. */ #define STACK_ALIGN 8 diff --git a/sysdeps/sparc/sparc32/pthreaddef.h b/sysdeps/sparc/sparc32/pthreaddef.h index 57fe5fd5143fc06e3758308f2c4fb82e38f15245..798c8837ea9141617611770293d32be9583b2042 100644 --- a/sysdeps/sparc/sparc32/pthreaddef.h +++ b/sysdeps/sparc/sparc32/pthreaddef.h @@ -18,6 +18,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* Required stack pointer alignment at beginning. */ #define STACK_ALIGN 16 diff --git a/sysdeps/sparc/sparc64/pthreaddef.h b/sysdeps/sparc/sparc64/pthreaddef.h index 62e2290b233ae9d72ced4fd755a7dfe7324026c5..b9f738f6a9afe11f5bb18b28b66a63f660bed048 100644 --- a/sysdeps/sparc/sparc64/pthreaddef.h +++ b/sysdeps/sparc/sparc64/pthreaddef.h @@ -18,6 +18,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (4 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* Required stack pointer alignment at beginning. */ #define STACK_ALIGN 16 diff --git a/sysdeps/tile/nptl/pthreaddef.h b/sysdeps/tile/nptl/pthreaddef.h index a1c00620bf350a14efdf029c027266300b1fb09e..6e09ef6d5c7355283948427f14a182ed4125aceb 100644 --- a/sysdeps/tile/nptl/pthreaddef.h +++ b/sysdeps/tile/nptl/pthreaddef.h @@ -22,6 +22,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* Required stack pointer alignment at beginning. */ #define STACK_ALIGN 16 diff --git a/sysdeps/x86_64/nptl/pthreaddef.h b/sysdeps/x86_64/nptl/pthreaddef.h index 036deb577238b652bdbae9dfb93fd1e160d132e9..0188113fb71356a98e6fc919b3cf4848b3ae23e6 100644 --- a/sysdeps/x86_64/nptl/pthreaddef.h +++ b/sysdeps/x86_64/nptl/pthreaddef.h @@ -19,6 +19,9 @@ /* Default stack size. */ #define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) +/* Minimum guard size. */ +#define ARCH_MIN_GUARD_SIZE 0 + /* Required stack pointer alignment at beginning. SSE requires 16 bytes. */ #define STACK_ALIGN 16