]> git.ipfire.org Git - thirdparty/systemd.git/commit
ask-password: prevent buffer overrow when reading from keyring
authorThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Mon, 13 May 2019 19:58:01 +0000 (16:58 -0300)
committerLennart Poettering <lennart@poettering.net>
Wed, 15 May 2019 08:49:46 +0000 (10:49 +0200)
commit59c55e73eaee345e1ee67c23eace8895ed499693
tree54efc4222d70a57ccca1bf4c63ecbd595fe8b155
parentdeb2cfa4c6885d448eb1f17e5ef1b139106b7e86
ask-password: prevent buffer overrow when reading from keyring

When we read from keyring, a temporary buffer is allocated in order to
determine the size needed for the entire data. However, when zeroing that area,
we use the data size returned by the read instead of the lesser size allocate
for the buffer.

That will cause memory corruption that causes systemd-cryptsetup to crash
either when a single large password is used or when multiple passwords have
already been pushed to the keyring.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
src/shared/ask-password-api.c