mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Albert Cahalan <acahalan@gmail.com>
To: Daniel Mack <daniel@caiaq.de>
Cc: linux-kernel@vger.kernel.org,
	Michael Hirsch <m.hirsch@raumfeld.com>,
	libertas-dev@lists.infradead.org, Dan Williams <dcbw@redhat.com>,
	netdev@vger.kernel.org, stable@kernel.org
Subject: Re: [PATCH] wireless: wext: allocate space for NULL-termination for  32byte SSIDs
Date: Tue, 15 Dec 2009 05:16:56 -0500	[thread overview]
Message-ID: <787b0d920912150216t58e817b2g64e8a19b0a1331bf@mail.gmail.com> (raw)
In-Reply-To: <1260650850-16163-1-git-send-email-daniel@caiaq.de>

On Sat, Dec 12, 2009 at 3:47 PM, Daniel Mack <daniel@caiaq.de> wrote:

> While the root cause turned out to be an issue with the wpa-supplicant
> which feeds the kernel driver with garbage, this occasion pointed out a
> bug in the wireless wext core when SSIDs with 32 byte lengths are passed
> from userspace. In this case, the string is not properly NULL-terminated
> which causes some other part to corrupt memory.

This is the wrong fix.

These are not strings. They are 32 arbitrary bytes. It is perfectly
legitimate to have a NUL byte in the middle; the use of C string
functions will corrupt the data.

For your testing I suggest:

a. start the SSID with '-'
b. include "/../" in the SSID
c. include UTF-16 surrogates wrongly encoded as UTF-8
d. include "\r\n" in the SSID
e. include quote and backslash characters in the SSID
f. include bytes in the 0x80 to 0x9f range, surrounded by ASCII
g. include bytes in the 0xc0 to 0xff range, surrounded by ASCII
h. include the sequence 0xc0,0x80 (Java UTF-8 pseudo-NUL)
i. include the NUL byte
j. end the SSID with a plain ASCII letter

Verify that the whole stack, from driver to GUI, can handle this.
That includes config files, command lines, /proc and /sys, etc.

  parent reply	other threads:[~2009-12-15 10:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-12 20:47 Daniel Mack
2009-12-15  9:43 ` David Miller
2009-12-15 10:03   ` Johannes Berg
2009-12-15 10:05     ` Johannes Berg
2009-12-15 10:07     ` Johannes Berg
2009-12-15 10:20       ` Daniel Mack
2009-12-15 10:31         ` Johannes Berg
2009-12-15 10:37           ` Daniel Mack
2009-12-15 10:30       ` Holger Schurig
2009-12-15 10:35         ` Johannes Berg
2009-12-16  6:54           ` Albert Cahalan
2009-12-16  8:19             ` Johannes Berg
2009-12-16  8:26             ` Holger Schurig
2009-12-16  3:58     ` Daniel Mack
2009-12-16  8:20       ` Johannes Berg
2009-12-15 10:16 ` Albert Cahalan [this message]
2009-12-15 16:29 ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=787b0d920912150216t58e817b2g64e8a19b0a1331bf@mail.gmail.com \
    --to=acahalan@gmail.com \
    --cc=daniel@caiaq.de \
    --cc=dcbw@redhat.com \
    --cc=libertas-dev@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.hirsch@raumfeld.com \
    --cc=netdev@vger.kernel.org \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®