mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 12:16:41 +00:00
eCryptfs: use list_for_each_entry_safe() when wiping auth toks
Use list_for_each_entry_safe() when wiping the authentication token list. Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
f4aad16adf
commit
e0869cc144
@ -469,26 +469,19 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
|
|||||||
|
|
||||||
static void wipe_auth_tok_list(struct list_head *auth_tok_list_head)
|
static void wipe_auth_tok_list(struct list_head *auth_tok_list_head)
|
||||||
{
|
{
|
||||||
struct list_head *walker;
|
|
||||||
struct ecryptfs_auth_tok_list_item *auth_tok_list_item;
|
struct ecryptfs_auth_tok_list_item *auth_tok_list_item;
|
||||||
|
struct ecryptfs_auth_tok_list_item *auth_tok_list_item_tmp;
|
||||||
|
|
||||||
walker = auth_tok_list_head->next;
|
list_for_each_entry_safe(auth_tok_list_item, auth_tok_list_item_tmp,
|
||||||
while (walker != auth_tok_list_head) {
|
auth_tok_list_head, list) {
|
||||||
auth_tok_list_item =
|
list_del(&auth_tok_list_item->list);
|
||||||
list_entry(walker, struct ecryptfs_auth_tok_list_item,
|
|
||||||
list);
|
|
||||||
walker = auth_tok_list_item->list.next;
|
|
||||||
memset(auth_tok_list_item, 0,
|
|
||||||
sizeof(struct ecryptfs_auth_tok_list_item));
|
|
||||||
kmem_cache_free(ecryptfs_auth_tok_list_item_cache,
|
kmem_cache_free(ecryptfs_auth_tok_list_item_cache,
|
||||||
auth_tok_list_item);
|
auth_tok_list_item);
|
||||||
}
|
}
|
||||||
auth_tok_list_head->next = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct kmem_cache *ecryptfs_auth_tok_list_item_cache;
|
struct kmem_cache *ecryptfs_auth_tok_list_item_cache;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parse_tag_1_packet
|
* parse_tag_1_packet
|
||||||
* @crypt_stat: The cryptographic context to modify based on packet
|
* @crypt_stat: The cryptographic context to modify based on packet
|
||||||
|
Loading…
Reference in New Issue
Block a user