This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] nss_files: Fix /etc/aliases null pointer dereference [BZ #24059]
- From: Szabolcs Nagy <Szabolcs dot Nagy at arm dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: nd <nd at arm dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Fri, 1 Feb 2019 17:21:37 +0000
- Subject: Re: [PATCH] nss_files: Fix /etc/aliases null pointer dereference [BZ #24059]
- References: <87a7k1531v.fsf@oldenburg2.str.redhat.com> <723b2509-9df4-315e-6e02-18be9d1beb42@arm.com> <874l9na6as.fsf@oldenburg2.str.redhat.com>
On 01/02/2019 15:15, Florian Weimer wrote:
> * Szabolcs Nagy:
>
>> On 15/01/2019 15:54, Florian Weimer wrote:
>>> If /etc/aliases ends with a continuation line (a line that starts
>>> with whitespace) which does not have a training newline character,
>>> the file parser would crash due to a null pointer dereference.
>>>
>>> 2019-01-15 Florian Weimer <fweimer@redhat.com>
>>>
>>> [BZ #24059]
>>> * nss/nss_files/files-alias.c (get_next_alias): Handle
>>> continuation line without newline at the end.
>>> * nss/tst-nss-files-alias-truncated.c: New file.
>>> * nss/Makefile [$(build-shared)] (tests): Add
>>> tst-nss-files-alias-truncated.
>>> (tst-nss-files-alias-truncated): Link with libnss_files.so.
>>> * support/namespace.h (struct support_chroot_configuration): Add
>>> aliases member.
>>> (struct support_chroot): Add path_aliases member.
>>> * support/support_chroot.c (support_chroot_create): Handle
>>> aliases.
>>> (support_chroot_free): Free path_aliases.
>>
>> aarch64 buildbot consistently fails with
>>
>> FAIL: nss/tst-nss-files-alias-truncated
>>
>> error: tst-nss-files-alias-truncated.c:34: not true: e != NULL
>> error: support_isolate_in_subprocess.c:37: child process exited with status 256
>> error: 2 test failures
>>
>> i'm not yet sure why (passes with ./testrun.sh)
>
> I haven't seen that, and I don't know what could be causing it. I fear
> you have to debug it in the context of the build bot, sorry.
libnss_files.so.2 is not listed as explicit dependency
for some reason so it is not loaded at program startup,
but after chroot is entered, but it's not available in
the chroot so the first api call fails.
(the buildbot used a gcc-5 toolchain so now that we require
gcc-6 the aarch64 buildbot is dead anyway.)