net: sctp: sctp_auth_key_put: use kzfree instead of kfree
For sensitive data like keying material, it is common practice to zero out keys before returning the memory back to the allocator. Thus, use kzfree instead of kfree. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Acked-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
6cddded4af
Коммит
586c31f3bf
|
@ -71,7 +71,7 @@ void sctp_auth_key_put(struct sctp_auth_bytes *key)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (atomic_dec_and_test(&key->refcnt)) {
|
if (atomic_dec_and_test(&key->refcnt)) {
|
||||||
kfree(key);
|
kzfree(key);
|
||||||
SCTP_DBG_OBJCNT_DEC(keys);
|
SCTP_DBG_OBJCNT_DEC(keys);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче