Official MINIX sources - Automatically replicated from gerrit.minix3.org
Go to file
David van Moolenbroek 2ff64318e2 VFS: fix race condition in select(2)
A select query could deadlock if..

- it was querying a character or socket device that, at the start of
  the select query, was not known to be ready for the requested
  operations;
- this device could not be checked immediately, due to another ongoing
  query to the same character or socket driver;
- the select query had a timer that triggered before the device could
  be checked, thereby changing the select query to non-blocking.

In this situation, a missing flag check would cause the select code to
conclude erroneously that the operations which it flagged for later,
were satisfied.  At the same time, the same flag remained set, so that
the select query would continue to wait for that device.  This
resulted in a deadlock.  The same bug could most likely be triggered
through other scenarios that were even less likely to occur.

This patch fixes the race condition and puts in a hopefully slightly
more informative comment for the affected block of code.

In practice, the bug could be triggered fairly reliably by generating
lots of output in tmux.

Change-Id: I1c909255dcf552e6c7cef08b0cf5cbc41294b99c
2016-08-05 11:13:59 +00:00
bin Import NetBSD ps(1) 2016-01-13 20:32:52 +01:00
common w(1): switch to libkvm 2016-01-13 20:32:50 +01:00
crypto Fix ARM noassert builds -g/-O{s/0/1/2/3} 2016-01-24 18:56:38 +01:00
dist/pf/sbin/pfctl Import a subset of PF distribution files 2016-06-18 12:20:46 +00:00
distrib Clean up traces from long-gone sys_int86 interface 2016-07-20 19:00:44 +02:00
docs Import locale tools and ressource files 2016-07-09 12:18:33 +02:00
etc Import locale tools and ressource files 2016-07-09 12:18:33 +02:00
external Typo in hardfloat command-line fixup/replacement 2016-07-02 13:18:46 +02:00
games Fix ARM noassert builds -g/-O{s/0/1/2/3} 2016-01-24 18:56:38 +01:00
gnu gnu/texinfo: Disable -Werror for clang 2016-07-09 12:11:26 +02:00
include Start using sysctl(3) throughout userland 2016-01-13 20:32:45 +01:00
lib Import locale tools and ressource files 2016-07-09 12:18:33 +02:00
libexec ld.elf_so: sysctl support uncommented 2016-01-16 14:04:24 +01:00
minix VFS: fix race condition in select(2) 2016-08-05 11:13:59 +00:00
releasetools made minix3 bootable via EFI 2016-07-02 13:43:03 +02:00
sbin Fix ARM noassert builds -g/-O{s/0/1/2/3} 2016-01-24 18:56:38 +01:00
share Preparations for PAE support 2016-08-04 09:24:42 +02:00
sys Do not hide the MSG_NOSIGNAL flag 2016-06-18 12:20:48 +00:00
tests tests: add most kyua kernel tests 2016-01-16 14:04:25 +01:00
tools Import locale tools and ressource files 2016-07-09 12:18:33 +02:00
usr.bin Import locale tools and ressource files 2016-07-09 12:18:33 +02:00
usr.sbin Adapt MINIX-specific part of tools/installboot 2016-08-03 08:09:00 +02:00
.gitignore gitignore: ignore some more generated files 2012-12-06 13:29:20 +00:00
.gitreview build:update 'git review' config to match gerrit.minix3.org 2014-07-28 17:05:15 +02:00
build.sh NetBSD re-synchronization of the source tree 2016-01-13 20:32:14 +01:00
LICENSE Fix parameter parsing in cut 2010-01-21 10:16:05 +00:00
Makefile NetBSD re-synchronization of the source tree 2016-01-13 20:32:14 +01:00
Makefile.inc Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC) 2014-07-28 17:05:06 +02:00