This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Check return from htab_find_slot()
- From: Jeff Law <law at redhat dot com>
- To: Marcus Shawcroft <marcus dot shawcroft at linaro dot org>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 12 Nov 2013 09:18:10 -0700
- Subject: Re: [PATCH] Check return from htab_find_slot()
- Authentication-results: sourceware.org; auth=none
- References: <CABXK9ndzQBvW3u__mx1n+Pfi9RRnn8K2fB5czEdYT_joVYrXXg at mail dot gmail dot com>
On 11/12/13 08:34, Marcus Shawcroft wrote:
Note that if you define a trap instruction in the arm/aarch64 backends,
that will be used instead of a call to abort. Can you use the undefined
instruction to generate a suitable trap?
This patch addresses another issue highlighted by the recent "isolate
erroneous path" patch applied to gcc trunk.
The failure mechanism is similar to:
In this case htab_find_slot() may result in a call to calloc() and
hence may return NULL. The code in _dl_make_tlsdesc_dynamic does not
check the return value from htab_find_slot before dereferencing it.
The "isolate erroneous path" code in trunk gcc spots the ill defined
behaviour and inserts an abort(), this leads to a link error for at
least ARM and AArch64 builds of glibc.
This patch adds a check on the return value, I think the fix is
obvious, if I'll commit tomorrow if I don't get any objections.