From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1A6E3A4F32 for ; Thu, 23 Jul 2026 20:22:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784838170; cv=none; b=navMGyQPbiLbmxvdXcmvOs8iK8Odk1bstVT/bdIabs145z/V1T3vhvEF3CR1XmJEVCRvgBpjj4IynOFTFw4nAiAZ0rLrgFefzt7TVSCIiYceSZM56KvMos0bb4uAhd6v9UV7NWWoS4QYgSnL96IbEIiAAOo0l8F3GdNc0xnChP0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784838170; c=relaxed/simple; bh=V1hSLIbjJIafMetq/iu7GVV4opdCYHpidy44iIwNch8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SffzjZ2oM+fF9naRB+9nKssgmsfQScvTnTFMDroEIf8b/ztVOJtoqp8hvGu2sjjNH7+7A0GbNDHLRmSEmq8yk1xgg6XbfoyHpT4glB55oWkxaZPJWihkZjE+Ailx3xMfuXoK1VooPJPuyNZuPyHjWomtm7uFJyjI4Q4Xjok3H2U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TilODulu; arc=none smtp.client-ip=209.85.216.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TilODulu" Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-38ec1402b05so833403a91.2 for ; Thu, 23 Jul 2026 13:22:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784838168; x=1785442968; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=RH1XbIQ8E22rKZgx9gpnUFs1WJC3giaIlWrSChX8/Ts=; b=TilODulueoL/PJBkHi8xBYdEPsnMCNT50kBf3ENkkPC/+yKfM74WUpIqb1so5fSe0L BfflNomGSL0KdJf7B3EvrnuQi4pL02NW2J/x4ONUqibxRoMEoj8QaIgG2qV3VAfdcIse Pmy6pPOhFfw/W3vc5j1/OXy9D6LqzpsKNHApmM+HqvEHwYcXNQ5RiUtsUyoDPeyL1ovg a9ADAyu5UrbMKg6kOdc2L3fJf6ScvlN4ez//IMr6Thuh9H80Zvd3U2TcirVNVO7E0w6z 85toKncOq/KSvl1DKYcudcwWWpvdeM+0oE8C+1xxbd4kt7xagBzwq7d/EzS2NqB7EwGE UMyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784838168; x=1785442968; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=RH1XbIQ8E22rKZgx9gpnUFs1WJC3giaIlWrSChX8/Ts=; b=TzKQk49tV/Bh1B0kSXaKUABTvqpcPLyJdu9HnZ6/PHKLzg85mws0PZ4ARgoTsrC2mf k6LZx7JlZoaau3WpPgC2+EWepkDuMX6xeMM0J8cTIoCVhMfCnO2dESOLnzAUsbJc0Euy N484F4xRB14gBNUtBqlrt/3nUZgcO8FfXXP02F3kNJIA/n/i7Q4Dlc8GGMlLYPq66BBK FR6LEVjeVwhPtKaXNburFsb6zh+PURqf0gV+HSvjINzgGo1J08W+3qlTBzvzu4ErfegM ZCBd4l+YaND9756rsgzlUU515WQPQtObNs5AT3qBImfIPyLGnrz9T8AXkxbEkR9TRE6T 7fhA== X-Forwarded-Encrypted: i=1; AHgh+RqSqnSn9jmEUx2LViuTCrJf3oPRv5wvLv3ABZTBAxaHTsD7Ap+uqAx7OVJLU7hzto0ejEd4i5IMNWogA4c=@vger.kernel.org X-Gm-Message-State: AOJu0YxqMuJJwK8gStBNX68l4ixal1ZElEb12AX+4kvjJUhgwRxdZarE Vjc+w+OCuJqblo0kYvD62b6/DY+JAsShiybqeqaALHoi8VPfYAs0qi+/ X-Gm-Gg: AR+sD10IPrTlQvaxx3FwQM0UQJroXx5laW4TCsTkdwju0qassv3bqSz7sB3SQhbrBg/ PTbVEH9ltBwunmRex26UqYR5eBfw4SqcK5bEHUFoCVoMnHt1+5rpXHmmoO41gW1vfb+Hozy1ghS TD+E4JruBITI/etepELQbqHQhpR6AY2zN/KlaA9BaNTtWWL55LZJVF0tmvgZe7fDRdI8UALYDwp 5z7d2UHM1BVgEdAkLnQKIajHDDrhoFLVTwzGCcz6ILa5oAzRYklz1LfE/ENwRuZfzAIQSsoyLTf 32Uxjju5RpxJ6fM+O4tc+83LFz374qUn1I1EUD/n6m0LOoNBq+zP+QXVK7mn0hO0PgGE783dZOm yaZl/H9tdXjr9q8spRtpyl3FbBNMVEajD23YWNiHbS/svd+nWp6OBcgKRhConocCP+bamFRFbDq gfj145k6u8HiA6K7/JSYD/w0hELFNohrbvaUhrX/M1 X-Received: by 2002:a17:90b:5588:b0:38e:6a44:671b with SMTP id 98e67ed59e1d1-38ec6281ddemr4527010a91.0.1784838168031; Thu, 23 Jul 2026 13:22:48 -0700 (PDT) Received: from KRHW1CJW23.bytedance.net ([61.141.241.112]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38f058118f2sm140429a91.1.2026.07.23.13.22.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Jul 2026 13:22:47 -0700 (PDT) From: Zhao Li To: Francesco Dolcini Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Johannes Berg , Brian Norris , stable@vger.kernel.org Subject: Re: [PATCH v2] wifi: mwifiex: validate action frame fixed fields Date: Fri, 24 Jul 2026 04:22:39 +0800 Message-ID: <20260723202239.158-1-enderaoelyther@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260723144127.GA234631@francesco-nb> References: <20260723144127.GA234631@francesco-nb> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Thu, 23 Jul 2026 at 16:41:27 +0200, Francesco Dolcini wrote: > I am confused, why is this check needed here, and not done in > mwifiex_process_mgmt_packet()? I double-checked the arithmetic and, yes, I made a mistake. The header check is redundant while the other two checks are needed. mwifiex_process_mgmt_packet() already validates: if (pkt_len < sizeof(struct ieee80211_hdr) + sizeof(pkt_len)) { After subtracting sizeof(pkt_len), the len passed into mwifiex_parse_mgmt_packet() is at least sizeof(struct ieee80211_hdr). So the if (len < sizeof(*ieee_hdr)) guard is redundant. The remaining two guards check that the category and action_code bytes are present beyond the header. Keeping these subtype-specific checks in the parser places them next to the corresponding reads. I will drop the redundant header check and resend as v3. Thanks, Zhao