]> git.ipfire.org Git - thirdparty/util-linux.git/commit
agetty: Fix a use of uninitialised memory in an agetty error path.
authorSteven Smith <sos22@archy.org.uk>
Fri, 17 Nov 2017 16:44:33 +0000 (08:44 -0800)
committerKarel Zak <kzak@redhat.com>
Tue, 21 Nov 2017 09:54:39 +0000 (10:54 +0100)
commitd23597a88cdbdbc7f2a1c84cd6fe0b2ad9f7e87b
treecc2b29d1d0d0f0b8aeb1940efee0877917a2bef8
parentf024c96c3461ad15f74dfb451225524615b4e8dd
agetty: Fix a use of uninitialised memory in an agetty error path.

get_logname() assumes that when it calls read() it initializes c and
errno, which isn't always true if we hit a whitelisted error or end of
file. This occasionally shows up as agetty going into an infinite
loop. Fix it by just delaying ten seconds and exiting when things go
wrong, similarly to the behavior after a non-whitelisted error.

[kzak@redhat.com: - interpret readres == 0 as c = 0
                  - ignore speed configurations for VCONSOLE]

Signed-off-by: Steven Smith <sos22@srcf.ucam.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/agetty.c