Return-path: Received: from vserver.eikelenboom.it ([84.200.39.61]:46533 "EHLO smtp.eikelenboom.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964922AbaDIU22 (ORCPT ); Wed, 9 Apr 2014 16:28:28 -0400 Date: Wed, 9 Apr 2014 22:28:23 +0200 From: Sander Eikelenboom Message-ID: <884167022.20140409222823@eikelenboom.it> (sfid-20140409_222831_582498_AF64D53C) To: Arik Nemtsov CC: Colleen T , "Luis R. Rodriguez" , Janusz Dziedzic , Johannes Berg , linux-wireless Subject: Re: [PATCH 2/3] cfg80211: fix processing world regdomain when non modular In-Reply-To: References: <1393376982-28276-1-git-send-email-mcgrof@do-not-panic.com> <1393376982-28276-3-git-send-email-mcgrof@do-not-panic.com> <1393852248.10039.5.camel@jlt4.sipsolutions.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-wireless-owner@vger.kernel.org List-ID: Wednesday, April 9, 2014, 6:33:09 PM, you wrote: > Hey Collen, Luis, > On Sun, Mar 16, 2014 at 9:04 PM, Colleen T wrote: >> On Sat, Mar 15, 2014 at 9:42 PM, Luis R. Rodriguez >> wrote: >>> On Sat, Mar 15, 2014 at 8:59 AM, Janusz Dziedzic >>> wrote: >>>> 2014-03-15 2:03 GMT+01:00 Luis R. Rodriguez : >>>>> On Fri, Mar 14, 2014 at 3:12 PM, Colleen T wrote: >>>>>> I'm on mac80211-next/master, sha is >>>>>> 5a970df8990d173e7e4092952f2e3da1de69b27d >>>>> >>>>> I tried to reproduce by just merging the fixes in question onto Linus' >>>>> tree and using radios=3 but no go. Can you provide the full kernel >>>>> log, I'm particularly interested in what happened before. The >>>>> COUNTRY=US on debian, which I believe you're on, should just trigger a >>>>> regulatory domain setting to US upon initialization. Depending on how >>>>> Debian does it this could either trigger as a module parameter or as a >>>>> userspace event *after* the world regdom get set. >> >> I'm attaching a full kernel log that shows the warning being >> triggered. You are correct, I'm on debian. In the attached case I >> ran: >> $ modprobe mac80211_hwsim radios=4 >> I pulled the fixes onto Linus' tree and I end up with the same result. >> > Seems I might have found the culprit - reg_todo is called while the > request to CRDA is in flight and the patch in question causes the > already-in-process user-request to be handled again. Since it's the > same regdomain as the last request (it's the last request itself), we > get this: > treatment = __reg_process_hint_user(user_request); > if (treatment == REG_REQ_IGNORE || > treatment == REG_REQ_ALREADY_SET) { > kfree(user_request); <------ > return treatment; > } > Can you try adding the attached patch? It just replaced relevant > kfree-s with a function that avoids freeing the last request. > Also, in the current scheme of things, CRDA might be called twice for > the same request in some corner cases, but that's not a problem, since > reg_is_valid_request() will block the second set_regdom(). > Regards, > Arik Thanks for looking in to this .. hope that this will make it go to upstream one day :-)