Date: Thu, 7 May 2020 02:16:25 +0000 (UTC) From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r360746 - stable/11/sys/netinet Message-ID: <202005070216.0472GPVN087984@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Thu May 7 02:16:25 2020 New Revision: 360746 URL: https://svnweb.freebsd.org/changeset/base/360746 Log: MFC r353303: Improve SCTP packet handling Validate length before use it, not vice versa. r353060 should have contained this... This fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18070 Modified: stable/11/sys/netinet/sctp_asconf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_asconf.c ============================================================================== --- stable/11/sys/netinet/sctp_asconf.c Thu May 7 02:13:28 2020 (r360745) +++ stable/11/sys/netinet/sctp_asconf.c Thu May 7 02:16:25 2020 (r360746) @@ -332,11 +332,11 @@ sctp_process_asconf_delete_ip(struct sockaddr *src, #endif aparam_length = ntohs(aph->ph.param_length); - ph = (struct sctp_paramhdr *)(aph + 1); - param_type = ntohs(ph->param_type); if (aparam_length < sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_paramhdr)) { return (NULL); } + ph = (struct sctp_paramhdr *)(aph + 1); + param_type = ntohs(ph->param_type); #if defined(INET) || defined(INET6) param_length = ntohs(ph->param_length); if (param_length + sizeof(struct sctp_asconf_paramhdr) != aparam_length) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005070216.0472GPVN087984>