From nobody Tue Feb 22 22:30:46 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D5F0419DEAF0; Tue, 22 Feb 2022 22:30:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K3DQZ5jFfz3Gs3; Tue, 22 Feb 2022 22:30:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645569046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T8Rm6ot3MXo4acQh4yqdTOrwEN5w1aV/AmPmKhBHtWQ=; b=ZZw5eAvETwknZQQoZlxfwOMWE5ZIjMoRWp1FhqikzwNtblY6vLRCrGLVlDv6z5mLnHwugq es4NEXKd0FpKAGxgslhs+5S3siSRRPaTYZvOGNDUoaAvRNBZDu7+JrT+rBgTl7/vsmpePR 7nQeviUX+XY/588FvSFGegdYrqMaDhpJo/3xMGv1EcebzXJgBWHywlnmLSUcYX8tujqfd8 924dDbBDahjHRNABC2bRnutqkCvdc94o562lIemW4Cbl59Zt51igAR/oemewnH/GZaQNTv fuwgm8XP1OZ31Nv8TDhW+MwxdiEL9Ha8ng6GxcJ0zZRFpW5L+WId/b3t1G8AIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A48CB4B82; Tue, 22 Feb 2022 22:30:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21MMUknf036222; Tue, 22 Feb 2022 22:30:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21MMUkG7036221; Tue, 22 Feb 2022 22:30:46 GMT (envelope-from git) Date: Tue, 22 Feb 2022 22:30:46 GMT Message-Id: <202202222230.21MMUkG7036221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 4b3cfa86d05f - stable/13 - sctp: improve input validation of mapped addresses in sctp_connectx() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4b3cfa86d05f6a17fb19f91ebd40e4682d919850 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645569046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T8Rm6ot3MXo4acQh4yqdTOrwEN5w1aV/AmPmKhBHtWQ=; b=n14EtjXp83KqRHtb5+A8rJRLcL1d5yHOWdnYd0o1CUcpL/hUvdgwuSFAO+T+wPV/1+Qtw4 jNESktgfzy0YKB8ZWQEzK+3CyLviBmVdVZ2mFlHTXUfVKtXAfUS6CK34HLX0R05SVesJWc ENk7X+nsxEUChi7Y+P1HxoB+YawLKysq+1C8DAcrcCDkbQaeAdEk1fLY+7IV3kd4gvnuTo g5+b9RUeTzcRMCchrckuwae9c0p/6Msc+0od6eMYYC2q8dWFydRq1oRH/UJlZUDXht0hEU ibrNKV3erSArtG6Aq6V58Tz/zYzoJE8IXPeWcrcyInmKfeJIUnkSS4XPftDqfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645569046; a=rsa-sha256; cv=none; b=DatvakNaMlEvD2Qrchn+UJdPxyjRaZCA5BB1KJ6Nl6YUuo4v0wHrwiVXIDzEt+w/b5LjQ2 fuAodbDmRoYVr8LlRrbjPXqozINPcMlbTZvtgPYmn+tkIEIj+ftVH5XgXHjPpPtWIxvtxe vno+rVVpX/oAY1cSenkNrdqSFheG6VKRMytT4tWY1g35XLBekCAnBevrPgIP0c1EG+e8HG rHUamh6OT/BRyPB7ykape/yFY16lUDPpPbJF7Pzf22FlluKzjsxynjYp+tlqJ1CzSZOYZT JkOjwcpdt6pOQ2z1y/RU/LztfgGM/2fHzAcaV4vBTvS+/MoEUN/zAlWhjB6+Xg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=4b3cfa86d05f6a17fb19f91ebd40e4682d919850 commit 4b3cfa86d05f6a17fb19f91ebd40e4682d919850 Author: Michael Tuexen AuthorDate: 2021-08-07 13:12:09 +0000 Commit: Michael Tuexen CommitDate: 2022-02-22 22:30:20 +0000 sctp: improve input validation of mapped addresses in sctp_connectx() (cherry picked from commit 112899c6afc5d174445b6ab4738b8eb4de19d835) --- sys/netinet/sctputil.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 42e91e10a0d9..7d6b932b4dc1 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -6715,15 +6715,15 @@ sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr, { struct sockaddr_in6 *sin6; + incr = (unsigned int)sizeof(struct sockaddr_in6); + if (sa->sa_len != incr) { + return (EINVAL); + } sin6 = (struct sockaddr_in6 *)sa; if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { /* Must be non-mapped for connectx */ return (EINVAL); } - incr = (unsigned int)sizeof(struct sockaddr_in6); - if (sa->sa_len != incr) { - return (EINVAL); - } (*num_v6) += 1; break; }