Return-path: Received: from mail-lb0-f182.google.com ([209.85.217.182]:53784 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756551Ab3FSNoe (ORCPT ); Wed, 19 Jun 2013 09:44:34 -0400 Received: by mail-lb0-f182.google.com with SMTP id r11so4810727lbv.27 for ; Wed, 19 Jun 2013 06:44:32 -0700 (PDT) Message-ID: <51C1B5C3.8080604@cogentembedded.com> (sfid-20130619_154447_273345_A0667299) Date: Wed, 19 Jun 2013 17:44:35 +0400 From: Sergei Shtylyov MIME-Version: 1.0 To: Johannes Berg CC: Linus Torvalds , David Miller , John Linville , Linux Wireless List , Network Development Subject: Re: [PATCH] nl80211: fix attrbuf access race by allocating a separate one References: <20130618.190632.33329016434510583.davem@davemloft.net> (sfid-20130619_042459_700600_08CD35A3) <1371628488.8349.3.camel@jlt4.sipsolutions.net> (sfid-20130619_095509_334897_6BA231FA) <1371630238.8349.6.camel@jlt4.sipsolutions.net> In-Reply-To: <1371630238.8349.6.camel@jlt4.sipsolutions.net> Content-Type: text/plain; charset=UTF-8; format=flowed Sender: linux-wireless-owner@vger.kernel.org List-ID: Hello. On 19-06-2013 12:23, Johannes Berg wrote: > From: Johannes Berg > Since my commit 3713b4e364, nl80211_dump_wiphy() uses the global Please also specify that commit's summary line in parens. > nl80211_fam.attrbuf for parsing the incoming data. This wouldn't > be a problem if it only did so on the first dump iteration which > is locked against other commands in generic netlink, but due to > space constraints in cb->args (the needed state doesn't fit) I > decided to always parse the original message. That's racy though > since nl80211_fam.attrbuf could be used by some other parsing in > generic netlink concurrently. > For now, fix this by allocating a separate parse buffer (it's a > bit too big for the stack, currently 1448 bytes on 64-bit). For > -next, I'll change the code to parse into the global buffer in > the first round only and then allocate a smaller buffer to keep > the state in cb->args. > Reported-by: Linus Torvalds > Signed-off-by: Johannes Berg WBR, Sergei