From patchwork Mon Jul 19 14:51:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 481946 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C303DC07E9D for ; Mon, 19 Jul 2021 15:12:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ACEBC61221 for ; Mon, 19 Jul 2021 15:12:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245241AbhGSOb2 (ORCPT ); Mon, 19 Jul 2021 10:31:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:38762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244639AbhGSO3y (ORCPT ); Mon, 19 Jul 2021 10:29:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 486CF6113B; Mon, 19 Jul 2021 15:10:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626707428; bh=IcrrfMENSAMzCA8Bq393mwfNqrFuA/ur07uvUXWQVF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lsapD+dQZQDy9v5wGXnYqaBvN4pNvO4LTYL9F5//4w//fACLOdBzgBvk6aTFev07F lkO5JcfozesrcM423mWqVz9lP+2CwAlRqTkI+bjSxxSOm+U3GAcYBoNXEG+FZI6MZJ SgAx3I1UelNLjvI7wKGtZz/yCZxoRocaQANqF/F4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, johannes@sipsolutions.net Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "linux-wireless@vger.kernel.org, stable@vger.kernel.org, Davis Mosenkovs" , Davis Mosenkovs Subject: [PATCH 4.9 160/245] mac80211: fix memory corruption in EAPOL handling Date: Mon, 19 Jul 2021 16:51:42 +0200 Message-Id: <20210719144945.576632083@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.288257948@linuxfoundation.org> References: <20210719144940.288257948@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Davis Mosenkovs Commit e3d4030498c3 ("mac80211: do not accept/forward invalid EAPOL frames") uses skb_mac_header() before eth_type_trans() is called leading to incorrect pointer, the pointer gets written to. This issue has appeared during backporting to 4.4, 4.9 and 4.14. Fixes: e3d4030498c3 ("mac80211: do not accept/forward invalid EAPOL frames") Link: https://lore.kernel.org/r/CAHQn7pKcyC_jYmGyTcPCdk9xxATwW5QPNph=bsZV8d-HPwNsyA@mail.gmail.com Cc: # 4.4.x Signed-off-by: Davis Mosenkovs Signed-off-by: Greg Kroah-Hartman --- net/mac80211/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2380,7 +2380,7 @@ ieee80211_deliver_skb(struct ieee80211_r #endif if (skb) { - struct ethhdr *ehdr = (void *)skb_mac_header(skb); + struct ethhdr *ehdr = (struct ethhdr *)skb->data; /* deliver to local stack */ skb->protocol = eth_type_trans(skb, dev);