Skip to content

Commit

Permalink
net: sctp: sctp_auth_key_put: use kzfree instead of kfree
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed Feb 8, 2013
1 parent 6cddded commit 586c31f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sctp/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void sctp_auth_key_put(struct sctp_auth_bytes *key)
return;

if (atomic_dec_and_test(&key->refcnt)) {
kfree(key);
kzfree(key);
SCTP_DBG_OBJCNT_DEC(keys);
}
}
Expand Down

0 comments on commit 586c31f

Please sign in to comment.