From patchwork Mon Jan 19 18:24:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 5660311 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 27E41C058D for ; Mon, 19 Jan 2015 18:25:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C2ED2042B for ; Mon, 19 Jan 2015 18:25:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 86FFD20364 for ; Mon, 19 Jan 2015 18:25:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752590AbbASSZL (ORCPT ); Mon, 19 Jan 2015 13:25:11 -0500 Received: from mail-wi0-f178.google.com ([209.85.212.178]:44298 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751996AbbASSZB (ORCPT ); Mon, 19 Jan 2015 13:25:01 -0500 Received: by mail-wi0-f178.google.com with SMTP id em10so7629080wid.5 for ; Mon, 19 Jan 2015 10:25:00 -0800 (PST) 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=4lCG6eomDz+qaWQy/tGDGFYSE8c8CYAks0b4mRoKIbg=; b=oXCWYMh+AJRnCpxMYQk3zkhdd5IF2i+IpVZkaMNA/eeQ5FOtCd3l8n56wfyxP+wrKP TNpBNVGcFv5f9cmsoI5tuhEhDrK4ScVEUCJkT6uVLtb7g2Fqg9du4gPC9Pnkkf+WO2HK y5L07128W8/Yl05WvLq3BPRPDbl7B2YnqKNuXfaYXnq0BDH+C7IJnTUH3E4YERr6PV0b NrT4jl+X0WonSiRybxa20xhYg8MqAVnz3MQk/7Cp41XURyHpNraXKw0XODBEL9zVQXDy TC8kcnD13mN5VBbhkX7x22rFLOxsQndxGLk0ubYBXkCpuz5Ql5jepywzk075MtmYzTdV jXlg== X-Received: by 10.194.84.240 with SMTP id c16mr3697950wjz.74.1421691900583; Mon, 19 Jan 2015 10:25:00 -0800 (PST) Received: from tipsey.3.home ([92.40.107.9]) by mx.google.com with ESMTPSA id j1sm18224728wjw.25.2015.01.19.10.24.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Jan 2015 10:25:00 -0800 (PST) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, Malcolm Priestley , Dan Carpenter Subject: [PATCH 5/6] staging: vt6655: Fix RFbSetPower() error: buffer overflow 'priv->abyCCKPwrTbl' 15 <= 56 Date: Mon, 19 Jan 2015 18:24:14 +0000 Message-Id: <1421691855-2927-5-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1421691855-2927-1-git-send-email-tvboxspy@gmail.com> References: <1421691855-2927-1-git-send-email-tvboxspy@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Check uCH is not more than CB_MAX_CHANNEL_24G(14) on rates RATE_1M to RATE_11M Return false as the call is invalid as these rates do not exist above channel 14. Reported-by: Dan Carpenter Cc: Dan Carpenter Signed-off-by: Malcolm Priestley --- drivers/staging/vt6655/rf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c index 27841aa..a6eabde 100644 --- a/drivers/staging/vt6655/rf.c +++ b/drivers/staging/vt6655/rf.c @@ -788,6 +788,9 @@ bool RFbSetPower( case RATE_2M: case RATE_5M: case RATE_11M: + if (uCH > CB_MAX_CHANNEL_24G) + return false; + byPwr = priv->abyCCKPwrTbl[uCH]; byPwrdBm = priv->abyCCKDefaultPwr[uCH]; break;