From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 8BE0EC11F6A for ; Fri, 2 Jul 2021 06:55:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A1F561156 for ; Fri, 2 Jul 2021 06:55:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230192AbhGBG5f (ORCPT ); Fri, 2 Jul 2021 02:57:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230189AbhGBG5c (ORCPT ); Fri, 2 Jul 2021 02:57:32 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10AD5C061762; Thu, 1 Jul 2021 23:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=+qqL3stcL81zEanpn177V008fhVVVkp46u6dRYOk8jE=; t=1625208900; x=1626418500; b=MPZAzch1bIKh9tGzRdo3GF5LQgPdbEUhuzDTvOfBZmSIjsK B4AIn5ItCPMUldEfC2Lifz51HM6Rreqdv/+S9x2Pj64rineD1Kp7L2gvGMtwcXvLnp2nxXewBPPeZ 8f/iBDYF1riboecutohjZwUF97E933/gHSqT9Dhsjz939q6F0Mkfef1QXIyPGLb9hKKgO705kY8Ev 1Zkb0uqi9iZD91GcYuW70gU5WV/x5+53xgYl9UHHDOIRgs0cXCC1sLJOvvYlMFNTFiIgY9MVKO+aI R/MPbzPwhB98E3WKKHl8NC2lEiLaIluJdq16/ML8r+DKxw1da7g7Tce6w+zwClQQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1lzD4g-00EYPk-1G; Fri, 02 Jul 2021 08:54:54 +0200 Message-ID: <56afa72ef9addbf759ffb130be103a21138712f9.camel@sipsolutions.net> Subject: Re: Posible memory corruption from "mac80211: do not accept/forward invalid EAPOL frames" From: Johannes Berg To: Davis Mosenkovs , Felix Fietkau Cc: Greg Kroah-Hartman , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Date: Fri, 02 Jul 2021 08:54:53 +0200 In-Reply-To: (sfid-20210701_225432_954258_7B6FE103) References: <872e3ea6-bbdf-f67c-58f9-4c2dafc2023a@nbd.name> (sfid-20210701_225432_954258_7B6FE103) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Thu, 2021-07-01 at 23:54 +0300, Davis Mosenkovs wrote: > > > > > It seems that the 4.4 backport is broken. The problem is the fact that > > > > skb_mac_header is called before eth_type_trans(). This means that the > > > > mac header offset still has the default value of (u16)-1, resulting in > > > > the 64 KB memory offset that you observed. Agree. > > > > I think that for 4.4, the code should be changed to use skb->data > > > > instead of skb_mac_header. 4.9 looks broken in the same way. > > > > 5.4 seems fine, so newer kernels should be fine as well. Also agree. > > > Thanks for looking into this, can you submit a patch to fix this up in > > > the older kernel trees? > > Sorry, I don't have time to prepare and test the patches at the moment. > > > If testing procedure mentioned in my first email is sufficient (and > using skb->data is the correct solution in kernel trees where current > code doesn't work properly), I can make and test the patches. > Should I do that? Yes, please do. Thanks, johannes