From patchwork Wed Jul 31 08:55:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 2836151 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7F00D9F7D6 for ; Wed, 31 Jul 2013 08:55:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B7417200F1 for ; Wed, 31 Jul 2013 08:55:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7696E201B8 for ; Wed, 31 Jul 2013 08:55:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759265Ab3GaIza (ORCPT ); Wed, 31 Jul 2013 04:55:30 -0400 Received: from ebb05.tieto.com ([131.207.168.36]:45821 "EHLO ebb05.tieto.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759213Ab3GaIzZ (ORCPT ); Wed, 31 Jul 2013 04:55:25 -0400 X-AuditID: 83cfa824-b7f718e000000f53-82-51f8d0f9b1d9 Received: from FIHGA-EXHUB01.eu.tieto.com ( [131.207.136.34]) by ebb05.tieto.com (SMTP Mailer) with SMTP id 9F.82.03923.9F0D8F15; Wed, 31 Jul 2013 11:55:22 +0300 (EEST) Received: from uw001058.eu.tieto.com (10.28.19.57) by inbound.tieto.com (131.207.136.49) with Microsoft SMTP Server id 8.3.298.1; Wed, 31 Jul 2013 11:55:20 +0300 From: Michal Kazior To: CC: , Michal Kazior Subject: [PATCH 4/5] ath10k: zero arvif memory on add_interface() Date: Wed, 31 Jul 2013 10:55:14 +0200 Message-ID: <1375260915-22500-5-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1375260915-22500-1-git-send-email-michal.kazior@tieto.com> References: <1375260915-22500-1-git-send-email-michal.kazior@tieto.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGIsWRmVeSWpSXmKPExsXSfL5DSffXhR+BBsviLB5dOsZs8WbFHXaL b1sfsDkwe3yeeZfNY/OSeo/Pm+QCmKO4bFJSczLLUov07RK4Mu7ufMVcMIO94vas5YwNjH9Y uxg5OSQETCQafkxlg7DFJC7cWw9kc3EICaxilOj9084E4SxllOjZcQCsik1AV+JV41mwbhEB BYlfkz6CxZkFfCWePVkG1MDBISzgKPFinhpImEVAVeLvx+ssIDavgLvEl0P3GUFKJIBa50yy AQlzCnhIXJz3nB0kLARU8u9kHUS1oMTJmU9YIIZLSBx88YIZxBYSUJE4uH4/8wRGgVlIymYh KVvAyLSKkT81KcnAVK8kM7UkXy85P3cTIzj4VqjsYDz7QOoQowAHoxIPr8f174FCrIllxZW5 hxglOZiURHm/n/8RKMSXlJ9SmZFYnBFfVJqTWnyIUYKDWUmEVz4IKMebklhZlVqUD5OS5mBR Euf1ygGaJJCeWJKanZpakFoEk5Xh4FCS4D0CMlSwKDU9tSItM6cEIc3EwQkynAdo+GqQGt7i gsTc4sx0iPwpRkUpcd6JIAkBkERGaR5cLyw5vGIUB3pFmPcDSBUPMLHAdb8CGswENHi3yjeQ wSWJCCmpBkb5zeY1F3S1g+Z+36/ULjtpfoO5WuGCquRFW64p6xQkyxXt/L6m4McjZnXBe0Vp 309Yh4TX63N41Ugs3KQsERHe0vpJqcDKTcyhx6qGM+HdjfNWkUZH/r4pNGHfUrkxr2tZccCs Ke7eRevCLm/dmFX05d3i76dE/HZsXqXuO+sGg8VPf7bt65VYijMSDbWYi4oTASpUqi/pAgAA Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 The private memory area in vif provided by mac80211 isn't guaranteed to be zeroed. This patch should fix issues when switching between STA and AP interface types. The tim_bitmap could become polluted by STA bssid field (since it's a union), wep_keys array could also become polluted with invalid pointers and probably much more. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 6a130c5..1aa5a39 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -1925,6 +1925,8 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, mutex_lock(&ar->conf_mutex); + memset(arvif, 0, sizeof(*arvif)); + arvif->ar = ar; arvif->vif = vif;