diff mbox series

[26/51] sctp: switch sctp_setsockopt_auth_key to use memzero_explicit

Message ID 20200719072228.112645-27-hch@lst.de
State Accepted
Delegated to: David Miller
Headers show
Series [01/51] sctp: copy the optval from user space in sctp_setsockopt | expand

Commit Message

Christoph Hellwig July 19, 2020, 7:22 a.m. UTC
Switch from kzfree to sctp_setsockopt_auth_key + kfree to prepare for
moving the kfree to common code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 net/sctp/socket.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index a573af7dfe41f5..365145746b559d 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -3649,7 +3649,8 @@  static int sctp_setsockopt_auth_key(struct sock *sk,
 	}
 
 out:
-	kzfree(authkey);
+	memzero_explicit(authkey, optlen);
+	kfree(authkey);
 	return ret;
 }