Skip to content

Commit 586c31f

Browse files
Daniel Borkmanndavem330
authored andcommitted
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>
1 parent 6cddded commit 586c31f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sctp/auth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void sctp_auth_key_put(struct sctp_auth_bytes *key)
7171
return;
7272

7373
if (atomic_dec_and_test(&key->refcnt)) {
74-
kfree(key);
74+
kzfree(key);
7575
SCTP_DBG_OBJCNT_DEC(keys);
7676
}
7777
}

0 commit comments

Comments
 (0)