Received: by 2002:ab2:f03:0:b0:1ef:ffd0:ce49 with SMTP id i3csp52592lqf; Tue, 26 Mar 2024 14:07:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU2gTVKwNkgjKaU3tjL3Y4kU0exmKgXtoJWSrTEGIaRxmd9MkA7HsIIK9Y5GDd3D8au2GRBttd5TYK7KUJQCg0NlyVIHqQABIUi55ogAg== X-Google-Smtp-Source: AGHT+IGpJ9D6xmAe/3tsLNEBSfCv6dE3bL04TgMJc9OPvOAqp62NDLYfcuCrCCEBEc5kMnUsaDYh X-Received: by 2002:a17:902:e5c4:b0:1e0:11a4:30e0 with SMTP id u4-20020a170902e5c400b001e011a430e0mr14325148plf.19.1711487253678; Tue, 26 Mar 2024 14:07:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711487253; cv=pass; d=google.com; s=arc-20160816; b=XhUonexF5a/OFC0AdPIkxnNsDs00HOsZ9RmskwpgnpbWAQrymspP4hzf8M1MXvO7Og zwGLe9A7If+fuXLtJq3jNagIkTbpJkX7hIFI77J+x6oR4exrLrGIrUSd+B7dMLINpzOu sRf5IWFv9tFsh4mttSdta77AnzDzkU8pZtoBZI5jpLYGzUlzl3uR0f4FV/4D6LiTEpyV q971br8VWSLvme4E+1W2Hp3V9+I3m65csyqKOOp2SEBqfXOE0xH+z1+Knsmq1UTnCcAS F+dEFSSnkkGKmDXnDc83j+viAGD6bxfUQEbzojc+vGU8pVf+rpUf/PV7j2BvrsehaRIw XNcw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=mIIGLinBxYbnxOYibGp7xqZdSaNB9FBeNNDKE73ThnM=; fh=rP579O5bEg982c5qIfHSP6i6jH+s1RS4RCqL2+Tp2LU=; b=pK7IE8jatg+1bvzreg/lamd5gjKK9lc14rZsLqwkncIsJKoh2G6+KwtdLN3hjaYst2 69m3gA3+1kkDpa8WsQNaKBC/fH9Xo3k76ZfBhIUCJ5KJpsKochIIDlFE8gMOfsbYXGdw RONUbU/z2XHA4r+X3CNbwl4n+3/WrhUvTbrL4M8DF1/I5HORrAbaaIzL8CulXK1TyQJb tkpXVztsvfMW6zWNYS5Twbvgfcdnji74wlPhy3+meE+0gDlckbXI9ZH/8Znm/0ZDdQ+u yX0Q1G71FwWHXnfYqIZD6N0lvRELQ6AcTM8EWiiokoFXe+fyBlWAwuxjvBfvpJb9i5hm HgyA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=QExyMkjn; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-5303-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5303-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id a3-20020a63d403000000b005d64d951c89si10622193pgh.143.2024.03.26.14.07.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 14:07:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5303-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=QExyMkjn; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-5303-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5303-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8BADAB2C5E8 for ; Tue, 26 Mar 2024 20:42:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53B3812B151; Tue, 26 Mar 2024 20:39:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="QExyMkjn" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2480C3DABF0 for ; Tue, 26 Mar 2024 20:39:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711485546; cv=none; b=BHmiibvSKiNbvrXRmCjEFqRssO8BAdrXLU5zpKYQYXJew7zk9gj7Dg7eK3NCNR72a+gYLb6/cbg7H1A/RdEqHlPF/SzMX+wuf3Q4nphXCbVR2sgBohGMOvlVPjlY9uI55gXccSpbmSmg/4DFi6HHzU7mLpuvKCLs8ocxEuVHgwo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711485546; c=relaxed/simple; bh=ec1iZUWICRrY3BnFaAg4nVTMTosH7b+7vtLa3x1W1t4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=e1xLjsp5VT/XuKpEyluRvw9X0MDlgq5pm25orV/wAESm2FmyO4cbqwH14E+58NfWc+in7FvnTveMRotnazGqbV2H7zfw5mXb1XBNtCv2DJXxSOuP6m0wOHG0YzNqF6FOUTCUCZQ+PUhxyI3hTqkn7Q09YXOAWL4KNhUBYGmjqi8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=QExyMkjn; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=mIIGLinBxYbnxOYibGp7xqZdSaNB9FBeNNDKE73ThnM=; t=1711485544; x=1712695144; b=QExyMkjny1pIK9bZJFtfjSFmNKMgQo5MDeptnFB1xnMWncsUY7Scq3WiwXSs5qnLcqIYJUP2h66 h7lqRpzFg3ZjvZxSWVgCZnrYd33jWzPlNM8QBdGrhVNKwR0IFaGMyUZNqGEHCEy49P75xOO3K5+aJ g4ijsWUZlCE6SzDrBtBgx0QYUji0G4mKDnX2Ze9tQtfPLjM1mbWYBhrabF1kzZTNaaUHPQRNbSzb2 SKtlOAj89M0EhnlLyBoehE2tzU50oENjQFae0lP3A3z48Kp/fE8E6jcSwvocr1pzX4VX7Pe29VGnr V1YRDZNr4opVidNV1Xfz4WdASEZOojDOjhgQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rpDZU-0000000FyOY-35Rg; Tue, 26 Mar 2024 21:39:01 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg , syzbot+75af45a00cf13243ba39@syzkaller.appspotmail.com Subject: [PATCH] wifi: mac80211: check EHT/TTLM action frame length Date: Tue, 26 Mar 2024 21:38:58 +0100 Message-ID: <20240326213858.19c84f34349f.I71b439f016b28f65284bb7646fe36343b74cbc9a@changeid> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg Check the EHT action frame length before accessing the action code, if it's not present then the frame cannot be valid. Reported-by: syzbot+75af45a00cf13243ba39@syzkaller.appspotmail.com Closes: https://lore.kernel.org/r/0000000000006c06870614886611@google.com/ Fixes: 8f500fbc6c65 ("wifi: mac80211: process and save negotiated TID to Link mapping request") Signed-off-by: Johannes Berg --- net/mac80211/rx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index c1f850138405..685185dc04f9 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -3780,6 +3780,10 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) } break; case WLAN_CATEGORY_PROTECTED_EHT: + if (len < offsetofend(typeof(*mgmt), + u.action.u.ttlm_req.action_code)) + break; + switch (mgmt->u.action.u.ttlm_req.action_code) { case WLAN_PROTECTED_EHT_ACTION_TTLM_REQ: if (sdata->vif.type != NL80211_IFTYPE_STATION) -- 2.44.0