Return-path: Received: from xc.sipsolutions.net ([83.246.72.84]:37252 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759678AbZLOKbt (ORCPT ); Tue, 15 Dec 2009 05:31:49 -0500 Subject: Re: [PATCH] wireless: wext: allocate space for NULL-termination for 32byte SSIDs From: Johannes Berg To: Daniel Mack Cc: David Miller , linux-kernel@vger.kernel.org, dcbw@redhat.com, m.hirsch@raumfeld.com, netdev@vger.kernel.org, libertas-dev@lists.infradead.org, stable@kernel.org, linux-wireless@vger.kernel.org In-Reply-To: <20091215102035.GJ28375@buzzloop.caiaq.de> References: <1260650850-16163-1-git-send-email-daniel@caiaq.de> <20091215.014308.77044043.davem@davemloft.net> <1260871411.3692.4.camel@johannes.local> <1260871634.3692.6.camel@johannes.local> <20091215102035.GJ28375@buzzloop.caiaq.de> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-MTUIoK4uGX41ZSlBruir" Date: Tue, 15 Dec 2009 11:31:23 +0100 Message-ID: <1260873083.3692.8.camel@johannes.local> Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: --=-MTUIoK4uGX41ZSlBruir Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2009-12-15 at 18:20 +0800, Daniel Mack wrote: > > > Since you indicate the kernel crashed, it is likely that libertas is > > > treating the buffer as a string, instead of an SSID. >=20 > Ok, I dodn't know that - thanks for pointing it out. In my setup here, > SSIDs are always valid alphanumeric strings, and I was mislead by the > comment that mentions the NULL-termination. Yeah ... that's an unfortunate historic mistake in wireless extensions that we try to fix up there. It cannot always be successfully fixed up, but the NUL-termination is nothing that anything but this code should be worried about or rely on. > > drivers/net/wireless/libertas$ grep lbs_deb_ * | grep ssid|grep '%s' > > assoc.c: lbs_deb_join("current SSID '%s', ssid length %u\n", > > assoc.c: lbs_deb_join("requested ssid '%s', ssid length %u\n", > > assoc.c: lbs_deb_join("ADHOC_START: SSID '%s', ssid length %u\n", > > scan.c: lbs_deb_wext("set_scan, essid '%s'\n", >=20 > Those macros are stubbed out as nops in my setup, so they can > unfortunately not be the reason. I'll dig deeper :) Well, the stack trace ought to help. johannes --=-MTUIoK4uGX41ZSlBruir Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIcBAABAgAGBQJLJ2V3AAoJEODzc/N7+Qmad3gQAJ1FPGr7txGCvsafXohdRLlh 7h7VnJQ21rmpB/g8KuKumBdUwh5ALEHmYNq5LMIbAGEzX7e7qOB5Dmhbh9BHWEzI Rs+rxA4kDom3fKx96P+O/6Nd4LCcVLql+tGcVZZMdEhDWJUFUcFfcEY793hDwcub LylfhXxRfcbIT5Kd2I9R6gqh3w7RT7ak6QP42lzab8L4s6vpAzudr7YImqAJMnOA Y3XjAFeqyxovu2EwiUIcyFDJGO805cbD16QsZiN3HwjNMya/VCZPe+TIDSPU3uOX IgsYdkyqgwsrOEsXj4drfiNBB68IGHLMej8dPoENLDHv1eoYafPgNEMHh3dQppE0 WMfgGz6EB8pQMWgLMHlLP2TFS7q0cBZJU2GPjdMNxi5bIY54NrU+TyxCjs09iolB TptMCsdzq/M89+x9H2mqlo8jti63UxuU5uLahywngWWMCOvdlVpSVFmnOmxf6EJu 4zrd3p2UpjI+xXqPAKVMVHJHdcl08Lz6xVZT3MVMkzJITUCyO/PWk06GzTMQA8+5 D0U7KkXJBOGdqrGWh4Fxi9EjXB6TPt5CjUu5vGBXfODtODjEPhC7otwEV2pzxePI uYZwg78VNnx3F6Dw0YLRHC/QxUkUBFj/btV1belk2LSGAQ9J5DwUibG0ffvWZdJM sinj7IxKO+iEcbH7H2KD =rYi1 -----END PGP SIGNATURE----- --=-MTUIoK4uGX41ZSlBruir--