]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdadm: Block SIGCHLD processes before starting children
authorLogan Gunthorpe <logang@deltatee.com>
Tue, 4 Jun 2024 16:38:37 +0000 (10:38 -0600)
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Thu, 13 Jun 2024 13:19:48 +0000 (15:19 +0200)
commit539ad6e6f9a067646a018d77582af0babf8e125e
treea84d4d14e5298c58b3f14e99b20810820f5d1e48
parent1a5c0e60308651a20d25ff52511230a20d830330
mdadm: Block SIGCHLD processes before starting children

There is a small race condition noticed during code review, but
never actully hit in practice, with the write_zero feature.

If a write zeros fork finishes quickly before wait_for_zero_forks()
gets called, then the SIGCHLD will be delivered before the signalfd
is setup.

While this is only theoretical, fix this by blocking the SIGCHLD
signal before forking any children.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Create.c