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=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 C23E7C0044D for ; Mon, 16 Mar 2020 14:26:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9556D2071C for ; Mon, 16 Mar 2020 14:26:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584368793; bh=q6g4WiBrZQGjlwO4bu6WdG3zLkNZcpFR8X1o1lWPCYw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=vXwOoigm9HrgYfjqz7i83OnJbc3eJWjV4BophYzjWw1QaemzoSmfCR5/WxBeaTmaO ZL6L2VVQTsB/oWHw/3EIkbKvcAKIEgczZN5lPgVqTfa3YlYejV5Qq5C2qnRJpe5syW z+2RnQDkta3xYErR2Txx+ByVCcbgBXvAyGu0OLwg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731470AbgCPO0d (ORCPT ); Mon, 16 Mar 2020 10:26:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:40790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729710AbgCPO0c (ORCPT ); Mon, 16 Mar 2020 10:26:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 04B5120719; Mon, 16 Mar 2020 14:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584368792; bh=q6g4WiBrZQGjlwO4bu6WdG3zLkNZcpFR8X1o1lWPCYw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FL9DcB0UwHx2nDkBr2BK509ErKJmjrChYiPMoNZfkHMv+gExb+lBkRuz1FkbSlsWb 86vmLAONpqamDXdOBtZWPAKR277jlm0nPwzdPwFnZj/Icng9Ki2gBDrVSuC8rV0giU QG1n4r7X4Ky98iviJC4W/1jXuRpxFIMw05RibQ2k= Date: Mon, 16 Mar 2020 15:26:30 +0100 From: Greg KH To: Matthias Maennich Cc: stable@vger.kernel.org, kernel-team@android.com, qize wang , Kalle Valo Subject: Re: [PATCH 4.4] mwifiex: Fix heap overflow in mmwifiex_process_tdls_action_frame() Message-ID: <20200316142630.GA4107198@kroah.com> References: <20200316141512.70762-1-maennich@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200316141512.70762-1-maennich@google.com> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Mon, Mar 16, 2020 at 03:15:12PM +0100, Matthias Maennich wrote: > From: qize wang > > mwifiex_process_tdls_action_frame() without checking > the incoming tdls infomation element's vality before use it, > this may cause multi heap buffer overflows. > > Fix them by putting vality check before use it. > > IE is TLV struct, but ht_cap and ht_oper aren’t TLV struct. > the origin marvell driver code is wrong: > > memcpy(&sta_ptr->tdls_cap.ht_oper, pos,.... > memcpy((u8 *)&sta_ptr->tdls_cap.ht_capb, pos,... > > Fix the bug by changing pos(the address of IE) to > pos+2 ( the address of IE value ). > > Signed-off-by: qize wang > Signed-off-by: Kalle Valo > (cherry picked from commit 1e58252e334dc3f3756f424a157d1b7484464c40) > Signed-off-by: Matthias Maennich > --- > drivers/net/wireless/mwifiex/tdls.c | 70 ++++++++++++++++++++++++++--- > 1 file changed, 64 insertions(+), 6 deletions(-) Now queued up, thanks. greg k-h