sctp: switch sctp_setsockopt_auth_key to use memzero_explicit
authorChristoph Hellwig <hch@lst.de>
Sun, 19 Jul 2020 07:22:03 +0000 (09:22 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Jul 2020 01:26:42 +0000 (18:26 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/socket.c

index a573af7..3651457 100644 (file)
@@ -3649,7 +3649,8 @@ static int sctp_setsockopt_auth_key(struct sock *sk,
        }
 
 out:
-       kzfree(authkey);
+       memzero_explicit(authkey, optlen);
+       kfree(authkey);
        return ret;
 }