Commit 1821df040ac3cd6a57518739f345da6d50ea9d3f

Authored by Roberto Sassu
Committed by Tyler Hicks
1 parent 50f198ae16

eCryptfs: ecryptfs_keyring_auth_tok_for_sig() bug fix

The pointer '(*auth_tok_key)' is set to NULL in case request_key()
fails, in order to prevent its use by functions calling
ecryptfs_keyring_auth_tok_for_sig().

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Cc: <stable@kernel.org>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>

Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff

fs/ecryptfs/keystore.c
... ... @@ -1563,6 +1563,7 @@
1563 1563 printk(KERN_ERR "Could not find key with description: [%s]\n",
1564 1564 sig);
1565 1565 rc = process_request_key_err(PTR_ERR(*auth_tok_key));
  1566 + (*auth_tok_key) = NULL;
1566 1567 goto out;
1567 1568 }
1568 1569 (*auth_tok) = ecryptfs_get_key_payload_data(*auth_tok_key);