]> git.ipfire.org Git - thirdparty/systemd.git/commit
pid1,vconsole-setup: lock /dev/console instead of the tty device
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 17 Oct 2023 17:43:31 +0000 (19:43 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 19 Oct 2023 17:03:21 +0000 (18:03 +0100)
commitaf189d7b50823876e71d1be5f5c575281ffb99c7
treec52410fbc70682f7b8fcabc0192753eb5904dfa6
parenta2dd5920021ab2f7ea41e3d517956524cfbe9c64
pid1,vconsole-setup: lock /dev/console instead of the tty device

As requested in https://github.com/systemd/systemd/pull/27867#pullrequestreview-1567161854.
/dev/console, /dev/tty0, and /dev/ttyN are "different" device nodes
that may point to a single underlying device. We want to use a single
lock so that we don't get a race if different writers are using a different
device path, so let's just always lock around /dev/console.
This effectively makes the locking less granular.

Fixup for a0043bfa51281c2374878e2a98cf2a3ee10fd92c.
Fixes https://github.com/systemd/systemd/issues/28721.
Maybe fixes https://github.com/systemd/systemd/issues/28778 and
https://github.com/systemd/systemd/issues/28634.
src/core/execute.c
src/shared/dev-setup.c
src/shared/dev-setup.h
src/vconsole/vconsole-setup.c