Subject: Re: bug#49209: coreutils: stack out-of-bounds write in tail --follow

From: Paul Eggert <[email-masked]>
Date: Thu, 24 Jun 2021 08:50:16 -0700

On 6/24/21 7:50 AM, Pádraig Brady wrote:
> We should be able to inotify_init() earlier in the process to avoid this 
> issue.

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.