svn commit: r352510 - stable/11/sys/netinet
Michael Tuexen
tuexen at FreeBSD.org
Thu Sep 19 10:06:18 UTC 2019
Author: tuexen
Date: Thu Sep 19 10:06:18 2019
New Revision: 352510
URL: https://svnweb.freebsd.org/changeset/base/352510
Log:
MFC r352438:
Only allow a SCTP-AUTH shared key to be updated by the application
if it is not deactivated and not used.
This avoids a use-after-free problem.
Reported by: da_cheng_shao at yeah.net
Modified:
stable/11/sys/netinet/sctp_auth.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/netinet/sctp_auth.c
==============================================================================
--- stable/11/sys/netinet/sctp_auth.c Thu Sep 19 10:01:19 2019 (r352509)
+++ stable/11/sys/netinet/sctp_auth.c Thu Sep 19 10:06:18 2019 (r352510)
@@ -521,7 +521,7 @@ sctp_insert_sharedkey(struct sctp_keyhead *shared_keys
} else if (new_skey->keyid == skey->keyid) {
/* replace the existing key */
/* verify this key *can* be replaced */
- if ((skey->deactivated) && (skey->refcount > 1)) {
+ if ((skey->deactivated) || (skey->refcount > 1)) {
SCTPDBG(SCTP_DEBUG_AUTH1,
"can't replace shared key id %u\n",
new_skey->keyid);
More information about the svn-src-stable-11
mailing list