eCryptfs: fix a couple type promotion bugs
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 4 Jul 2018 09:35:56 +0000 (12:35 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:28:42 +0000 (07:28 +0200)
commit1ef3575c51ee152d691570fb9ff77b1fcdd4fd03
tree7442c0fc2c756f342d9096ec590e8bb3ce8e95a1
parenta2d5e4e4237d21438bed59b1a6dc8348126a569d
eCryptfs: fix a couple type promotion bugs

commit 0bdf8a8245fdea6f075a5fede833a5fcf1b3466c upstream.

ECRYPTFS_SIZE_AND_MARKER_BYTES is type size_t, so if "rc" is negative
that gets type promoted to a high positive value and treated as success.

Fixes: 778aeb42a708 ("eCryptfs: Cleanup and optimize ecryptfs_lookup_interpose()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
[tyhicks: Use "if/else if" rather than "if/if"]
Cc: stable@vger.kernel.org
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ecryptfs/crypto.c