GNU bug report logs - #49209
coreutils: stack out-of-bounds write in tail --follow

Previous Next

Package: coreutils;

Reported by: Kamil Dudka <kdudka <at> redhat.com>

Date: Thu, 24 Jun 2021 14:27:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #19 received at 49209-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Stepan Broz <sbroz <at> redhat.com>
Cc: Kamil Dudka <kdudka <at> redhat.com>,
 Pádraig Brady <P <at> draigBrady.com>, 49209-done <at> debbugs.gnu.org
Subject: Re: bug#49209: coreutils: stack out-of-bounds write in tail --follow
Date: Sat, 26 Jun 2021 18:47:46 -0700
[Message part 1 (text/plain, inline)]
On 6/24/21 8:50 AM, Paul Eggert wrote:

> inotify_init can return 1025 even if called first thing, so we also need 
> to dup2 the result of early inotify_init down to 3 (or whatever), or at 
> least to check that it's less than 1024. Choosing 3 is a tricky 
> business, since it's not clear what fds the C library actually needs.

When looking into this I decided it was cleaner to fix coreutils by 
using 'poll' instead of 'select', as Kamil suggested. I installed the 
attached patches to do that. The last patch fixes the bug.

Thanks for reporting the problem.
[0001-maint-while-1-while-true.patch (text/x-patch, attachment)]
[0002-tail-fix-abuse2-test-race.patch (text/x-patch, attachment)]
[0003-tail-use-poll-not-select.patch (text/x-patch, attachment)]

This bug report was last modified 4 years and 19 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.