From patchwork Mon Jul 16 16:36:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Cavallari X-Patchwork-Id: 1201261 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 58FE83FC33 for ; Mon, 16 Jul 2012 16:37:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753354Ab2GPQhH (ORCPT ); Mon, 16 Jul 2012 12:37:07 -0400 Received: from smtp2.u-psud.fr ([129.175.33.42]:64550 "EHLO smtp2.u-psud.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753003Ab2GPQhG (ORCPT ); Mon, 16 Jul 2012 12:37:06 -0400 Received: from smtp2.u-psud.fr (localhost [127.0.0.1]) by localhost (MTA) with SMTP id C645134D8DC; Mon, 16 Jul 2012 18:37:04 +0200 (CEST) Received: from ext.lri.fr (ext.lri.fr [129.175.15.4]) by smtp2.u-psud.fr (MTA) with ESMTP id ABFF434D8D8; Mon, 16 Jul 2012 18:37:04 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ext.lri.fr (Postfix) with ESMTP id A3F6640A3F; Mon, 16 Jul 2012 18:37:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at lri.fr Received: from ext.lri.fr ([127.0.0.1]) by localhost (ext.lri.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2JRaLR9eVHRe; Mon, 16 Jul 2012 18:37:04 +0200 (CEST) Received: from smtp-ng.lri.fr (smtp [129.175.3.73]) by ext.lri.fr (Postfix) with ESMTP id 84091409F0; Mon, 16 Jul 2012 18:37:04 +0200 (CEST) Received: from lowerbit.lri.fr (lri25-36 [129.175.25.36]) by smtp-ng.lri.fr (Postfix) with ESMTP id 6DA96602EC; Mon, 16 Jul 2012 18:37:04 +0200 (CEST) From: Nicolas Cavallari To: Johannes Berg , "John W. Linville" Cc: linux-wireless@vger.kernel.org Subject: [PATCH] mac80211: Fix tx-mgmt cookie value being left uninitialized. Date: Mon, 16 Jul 2012 18:36:52 +0200 Message-Id: <1342456612-11706-1-git-send-email-cavallar@lri.fr> X-Mailer: git-send-email 1.7.10.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org commit "mac80211: unify SW/offload remain-on-channel" moved the cookie assignment from ieee80211_mgmt_tx() to ieee80211_start_roc_work(). But the latter is only called where offchannel is needed. If offchannel isn't needed/used, a uninitialized cookie value would be returned to userspace. This patch sets the cookie value when offchannel isn't used. Signed-off-by: Nicolas Cavallari --- based on wireless-testing. diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index cfdc03f..106f381 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2493,6 +2493,7 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, skb->dev = sdata->dev; if (!need_offchan) { + *cookie = (unsigned long) skb; ieee80211_tx_skb(sdata, skb); ret = 0; goto out_unlock;