Skip to content
Commit 46c16855 authored by David Oberhollenzer's avatar David Oberhollenzer
Browse files

mkfs.ubifs: fscrypt: bail from encrypt_block if gen_essiv_salt fails



What originally cought my attention was that gen_essiv_salt has a
size_t return type and error paths that return -1 on failure.
Further investigation revealed that the error value is never checked
for. The encrypt_block function doesn't use the return value in any
way and simply continues onward.

Furthermore, the gen_essiv_salt function has an error case that emits
an error message but returns success state.

This patch modifes gen_essiv_salt to return an error status in all
error branches, changes the return type to ssize_t and adds a check
to encrypt_block if gen_essiv_salt fails.

Signed-off-by: default avatarDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
parent 413b3c91
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment