[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fix race conditions in timeout(1)
From: |
Pádraig Brady |
Subject: |
Re: Fix race conditions in timeout(1) |
Date: |
Mon, 11 Mar 2024 16:22:05 +0000 |
User-agent: |
Mozilla Thunderbird |
On 11/03/2024 15:17, Pádraig Brady wrote:
There was a narrow race condition reported at:
https://github.com/coreutils/coreutils/issues/82
Then I noticed another related race condition
in the case of failing fork().
Both should be addressed by the attached.
Actually the second one to ensure processes are killed
is only moving the race around, since the child may
receive the signal in the same narrow window before assigning
monitored_pid, and ignore it.
The attached avoids the issue by blocking signal handling
until monitored_pid is in a deterministic state wrt fork().
I'll think a bit more about this before applying.
cheers,
Pádraig
0002-timeout-fix-narrow-race-in-failing-to-kill-processes.patch
Description: Text Data