From patchwork Thu Aug 16 00:15:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Pedersen X-Patchwork-Id: 1329061 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 46419DFFED for ; Thu, 16 Aug 2012 00:15:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752442Ab2HPAP1 (ORCPT ); Wed, 15 Aug 2012 20:15:27 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:4800 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752150Ab2HPAP0 (ORCPT ); Wed, 15 Aug 2012 20:15:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1345076127; x=1376612127; h=from:to:cc:subject:date:message-id:mime-version; bh=hSn/ajFGiy+MQJQLUQlLQYReYKxml5Ss147Uyzaowv8=; b=ZPrpeVvlQFM8aOVKCSM3VBf6ZtYL8qBZdYkS39atzuZmn/35zrV655u6 H4YAVA1pxY8pck2ikMPBDIgHpha95T14QWYLCVKQ8u8s+xJZRpzgCe8GL 0QAqMT/25Zas0olsM6g4r2S08M1fJKQoQky0qdHrqpKdVcBR9Buq7heUK g=; X-IronPort-AV: E=McAfee;i="5400,1158,6804"; a="225767928" Received: from ironmsg04-r.qualcomm.com ([172.30.46.18]) by wolverine01.qualcomm.com with ESMTP; 15 Aug 2012 17:15:27 -0700 X-IronPort-AV: E=Sophos;i="4.77,775,1336374000"; d="scan'208";a="369352329" Received: from nasanexhc04.na.qualcomm.com ([172.30.48.17]) by Ironmsg04-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 15 Aug 2012 17:15:27 -0700 Received: from qcmail1.qualcomm.com (172.30.48.1) by qcmail1.qualcomm.com (172.30.48.17) with Microsoft SMTP Server (TLS) id 14.2.309.2; Wed, 15 Aug 2012 17:15:24 -0700 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Wed, 15 Aug 2012 17:15:17 -0700 From: Thomas Pedersen To: CC: , , Thomas Pedersen Subject: [PATCH] ath6kl: protect firmware from excessive WoW pattern length Date: Wed, 15 Aug 2012 17:15:16 -0700 Message-ID: <1345076116-5053-1-git-send-email-c_tpeder@qca.qualcomm.com> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 X-Originating-IP: [172.30.48.1] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Don't accept WoW patterns longer than supported by firmware. Reported-by: Haijun Jin Signed-off-by: Thomas Pedersen --- drivers/net/wireless/ath/ath6kl/cfg80211.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index bd003fe..ffa18f3 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -1876,6 +1876,9 @@ static int ath6kl_wow_usr(struct ath6kl *ar, struct ath6kl_vif *vif, /* Configure the patterns that we received from the user. */ for (i = 0; i < wow->n_patterns; i++) { + if (wow->patterns[i].pattern_len > WOW_MASK_SIZE) + return -EINVAL; + /* * Convert given nl80211 specific mask value to equivalent * driver specific mask value and send it to the chip along