From patchwork Mon Jul 18 23:24:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 9235675 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 56F18600BC for ; Mon, 18 Jul 2016 23:25:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 484DE212CF for ; Mon, 18 Jul 2016 23:25:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D03426B41; Mon, 18 Jul 2016 23:25:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBBDD212CF for ; Mon, 18 Jul 2016 23:24:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752237AbcGRXYz (ORCPT ); Mon, 18 Jul 2016 19:24:55 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:32963 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752198AbcGRXYy (ORCPT ); Mon, 18 Jul 2016 19:24:54 -0400 Received: by mail-pf0-f195.google.com with SMTP id i6so121762pfe.0 for ; Mon, 18 Jul 2016 16:24:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mf5wyZfmWOENoGuGncAnJ0a3VWj7BraWLlNlP22DhyE=; b=djwQlvef8kAQ5sEILOQmaLnXSu1w4lTz5zTjGiaioCvVgfGTcxefYQVSSUB2l+DWgH 6yM4l2tkFa3Ua5HRv37RVlFGs+B3yxxhYbzp2g/K7EnwR1lDn8yVsD2p3qeS4GqcGe4N E+o4MSqrl9PmoxS82G6FFr9vnNS1Ws4HuSGFdC4FPaibNitWeS1LKn8zqxDWIEcYurJJ ygCW/m5aR79Duwry7nvUrVs9zmgbPh+6gt7VMYvNOzgo6E0pgwAkBL5HvKRkcHwjlaF0 jHC/npdD1Pf92soEVMbM7mtVntSF02cH/nAogHDGTdWDgESuNwvdsoZhXA+MXVdCo2QZ RXxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mf5wyZfmWOENoGuGncAnJ0a3VWj7BraWLlNlP22DhyE=; b=mxFW6JuB+fKBXLkWhcpMHYKrj5Zbo31UjAFm/VffnX2Pa4OjwHstXiSb61ok1WyNSG KieOe7bwHFYb6jREY851Lt8bKAdZJ7W3jUVL4CYJiMjVs23S0/62deb2/1LZUSwkU7rC fD6QPvPiJLJVrJmvksbZz9bWcJTuIgFN9PgKm/6RSCvDupek4oaLA3OqqzhhzInXPXkP kKznhSC8RwLodCOaXPoar/LqqhtDA7a9rhAeI6oLB7JYQMIlL1NcjzGnHOlNS+nZDs+j yrsCXqs6JanveQIyGeb2b7z3O8ePUpSp5M0elLTRJhUgAQxSbXtppxWyVPpSfd2/TUT0 6ZGw== X-Gm-Message-State: ALyK8tJvgYrlGD0DXJcOd1v3x2YPghO8GKbtEfvZbNPbsU4l1X1H5vXBtsmuhVF+0TNOVA== X-Received: by 10.98.135.13 with SMTP id i13mr50364561pfe.44.1468884293884; Mon, 18 Jul 2016 16:24:53 -0700 (PDT) Received: from fainelli-desktop.broadcom.com (5520-maca-inet1-outside.broadcom.com. [216.31.211.11]) by smtp.gmail.com with ESMTPSA id dz13sm6934659pac.44.2016.07.18.16.24.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jul 2016 16:24:53 -0700 (PDT) From: Florian Fainelli To: brcm80211-dev-list.pdl@broadcom.com Cc: linux-wireless@vger.kernel.org, pieterpg@broadcom.com, kvalo@codeaurora.org, arend.vanspriel@broadcom.com, hante.meuleman@broadcom.com, Florian Fainelli Subject: [PATCH 3/4] brcmsmac: Fix invalid memcpy() size in brcms_c_d11hdrs_mac80211 Date: Mon, 18 Jul 2016 16:24:36 -0700 Message-Id: <1468884277-18606-4-git-send-email-f.fainelli@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468884277-18606-1-git-send-email-f.fainelli@gmail.com> References: <1468884277-18606-1-git-send-email-f.fainelli@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP struct ieee80211_rts::ra is only ETH_ALEN wide, yet we attempt to copy 2 * ETH_ALEN, which will potentially overrun the destination buffer. Reported-by: coverity (CID 145657) Fixes: 5b435de0d7868 ("net: wireless: add brcm80211 drivers") Signed-off-by: Florian Fainelli --- drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c index c2a938b59044..59813a3666eb 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c @@ -6671,7 +6671,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw, rts->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS); - memcpy(&rts->ra, &h->addr1, 2 * ETH_ALEN); + memcpy(&rts->ra, &h->addr1, ETH_ALEN); } /* mainrate