diff options
author | Takashi Yano <takashi.yano@nifty.ne.jp> | 2024-03-04 11:32:34 +0900 |
---|---|---|
committer | Takashi Yano <takashi.yano@nifty.ne.jp> | 2024-03-04 11:58:09 +0900 |
commit | b160b690b6ace93ee4225f14a9287549e37f4a71 (patch) | |
tree | 48624d86e60f21a54b4f7e7aa680d75523362804 /winsup/cygwin/termios.cc | |
parent | abb532a87ff6ed37f6ee2c8a58c65178a15aa345 (diff) | |
download | newlib-b160b690b6ace93ee4225f14a9287549e37f4a71.zip newlib-b160b690b6ace93ee4225f14a9287549e37f4a71.tar.gz newlib-b160b690b6ace93ee4225f14a9287549e37f4a71.tar.bz2 |
Cygwin: console: Fix a race issue between close() and open().
The open() call for console sometimes fails if the console owner
process is closing the console by close() at the same time. This
is due to mismatch state of con.owner variable and attaching state
to the console. With this patch, checking con.owner and attaching
to con.owner sequence in open(), and resetting con.owner and freeing
console sequence in close() are guarded by output_mutex to avoid
such a race issue.
Addresses: https://cygwin.com/pipermail/cygwin/2024-March/255575.html
Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.")
Reported-by: Kate Deplaix <kit-ty-kate@outlook.com>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
Diffstat (limited to 'winsup/cygwin/termios.cc')
0 files changed, 0 insertions, 0 deletions