]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 66499] Detect jobserver values that are too large master
authorPaul Smith <psmith@gnu.org>
Sun, 8 Dec 2024 21:31:54 +0000 (16:31 -0500)
committerPaul Smith <psmith@gnu.org>
Mon, 9 Dec 2024 04:30:37 +0000 (23:30 -0500)
commitd523661ce21a16535d53fe56a3d3d8824432e18e
tree7432c6e64035f250d9a8074b0379d8885c36dc5b
parentf12a4fddce3f0475a114505a373374cf20f387e8
[SV 66499] Detect jobserver values that are too large

Set the jobserver pipe to non-blocking before writing tokens; if a
token write fails the user's jobserver value is too large so fail.

Original implementation: Dmitry Goncharov <dgoncharov@users.sf.net>

* src/posixos.c (set_blocking): Split into force_blocking() which
always enables/disables blocking; set_blocking() may call it.
(jobserver_setup): Set the write side of the pipe to non-blocking
before writing tokens.  If it fails with EAGAIN we know the pipe
is full: create a fatal error.
* tests/scripts/features/jobserver: Test a too-large jobserver.
src/posixos.c
tests/scripts/features/jobserver