From nobody Tue Mar 15 18:14:06 2022 X-Original-To: dev-commits-src-branches@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 BE51D1A22D3C; Tue, 15 Mar 2022 18:14:07 +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 4KJ1kl2S6nz57RD; Tue, 15 Mar 2022 18:14:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647368047; 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=ei+F+wk8rcgla9duLKGlBCED07GbnKreZlUXBuxtc4A=; b=vBdgLim77IfbhPPISo/rhMMYgakJEXJCpkWCpyo7FxaEpZ/Zt+ncX4XiB1pt64Htr66rz2 2qOV0v0jiug4t6Ob8WBRBTAbtG46Mmxb67xNxitTTCjYMYm/iu7pRvotbwXRMYplYGLlqB /C7d1SoOt1boNlT1Ft1SgsptZPHCRaCanQ2MKlhFtgomIhf88gpfk8iv7HpKU6I/GlZu03 AAid7xpVT1RSQbEyIz0cadHO7C9JvqVP8+Y1orpwIJN8i4YZ9PeWWwe289ylLn9CoWekyn +C7kaDVF0+PvZJJ8m1Ft1MRpAqbUn/Nl0OksHZdliKjl6+9AzvXTSvXUzpfIcA== 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 F20C7268D1; Tue, 15 Mar 2022 18:14:06 +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 22FIE6DV074975; Tue, 15 Mar 2022 18:14:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22FIE6Va074974; Tue, 15 Mar 2022 18:14:06 GMT (envelope-from git) Date: Tue, 15 Mar 2022 18:14:06 GMT Message-Id: <202203151814.22FIE6Va074974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 6eb932a96913 - releng/13.0 - net80211: proper ssid length check in setmlme_assoc_adhoc() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 6eb932a969139b9f42f0ad130bda36f0d709e2a9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647368047; 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=ei+F+wk8rcgla9duLKGlBCED07GbnKreZlUXBuxtc4A=; b=iOLdVT05U2VzN88+WsXCcjawdBCy3L/Wwa8g8eRDUkeh5RYH2qFqrUM1/V+ag/vkbkXxip cqaA3aG2+L6J+BptS22VPZ8ScjdCElmKjeu1yMxWivphl4Dp7oGKgrYDEWTPjAv77ouJTI WuYd9arOdJRa0WOLusl3tgE/IfSLE41Igczw2NPImLbwLEMmsanXLXaH+HgNEBGboUqk8E u0sfnFZ65duLAUoCkKmGfiVqx4fimrhV9yUM3hK8AroRRr6gQ/pJ+lKaljvtp6Ey/br1Jl rmhzJcr8bkp+qYacujNwBtFsI9hpYa4y8bLVXKU+qEciFPfwftzQ3Y5KIACvzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647368047; a=rsa-sha256; cv=none; b=tdLDbTwXFT3QTxZ6yjTaxjbKn57aXgK6Yc3QFXa4ykautxr6FqFTECANmgK4akETNkHMYV nqaEsfPjF4v0Mla+sQAmnQyc6V2Ep1EXUf7CTFWjho8n9sT6zIvXMMFkyEm9lqW61DfGWG a9rIHo1yFdOKaLdc8xFddfNOwQWkR6sDOm5rY7SrN1OkEjJ/OLAtHmXyZMM6dGqOdtV52v j0v85xaeQwOQWKI5ZkAWmESZ/jakiAwJlk/VCrhpciKqk4czvv/+JorBL6YWRoRzA3fLbu XElTQO3aarcVCp5SFkKEn+gyZopN8B5N7lmMomXfsq5jpBMvavDUVjSUN0gV/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6eb932a969139b9f42f0ad130bda36f0d709e2a9 commit 6eb932a969139b9f42f0ad130bda36f0d709e2a9 Author: Bjoern A. Zeeb AuthorDate: 2021-10-06 18:41:37 +0000 Commit: Mark Johnston CommitDate: 2022-03-15 17:45:27 +0000 net80211: proper ssid length check in setmlme_assoc_adhoc() A user supplied SSID length is used without proper checks in setmlme_assoc_adhoc() which can lead to copies beyond the end of the user supplied buffer. The ssid is a fixed size array for the ioctl and the argument to setmlme_assoc_adhoc(). In addition to an ssid_len check of 0 also error in case the ssid_len is larger than the size of the ssid array to prevent problems. PR: 254737 Reported by: Tommaso (cutesmilee.research protonmail.com) (cherry picked from commit 526370fb85db4b659cff4625eb2f379acaa4a1a8) (cherry picked from commit 0525ece3554edce14fa68a7fb61078ae2110c44b) (cherry picked from commit ab5678c6c0d0b28feafdb2fd397866d6088f37d8) Approved by: so Security: FreeBSD-SA-22:02.wifi --- sys/net80211/ieee80211_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 2fef9ac0084a..419518eb1224 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -1591,7 +1591,7 @@ setmlme_assoc_adhoc(struct ieee80211vap *vap, ("expected opmode IBSS or AHDEMO not %s", ieee80211_opmode_name[vap->iv_opmode])); - if (ssid_len == 0) + if (ssid_len == 0 || ssid_len > IEEE80211_NWID_LEN) return EINVAL; sr = IEEE80211_MALLOC(sizeof(*sr), M_TEMP,