linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dcbw@redhat.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: John Linville <linville@tuxdriver.com>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] libertas: fix buffer overrun
Date: Thu, 30 Oct 2008 00:10:53 -0400	[thread overview]
Message-ID: <1225339853.32092.18.camel@localhost.localdomain> (raw)
In-Reply-To: <1225277012.5439.0.camel@johannes.berg>

On Wed, 2008-10-29 at 11:43 +0100, Johannes Berg wrote:
> If somebody sends an invalid beacon/probe response, that can trash the
> whole BSS descriptor. The descriptor is, luckily, large enough so that
> it cannot scribble past the end of it; it's well above 400 bytes long.
> 
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> Cc: stable@kernel.org [2.6.24-2.6.27, bug present in some form since driver was added (2.6.22)]

Acked-by: Dan Williams <dcbw@redhat.com>

> ---
> Not really tested for lack of hw.
> 
> John, this is part of the other patch I sent, but this one's
> for 2.6.28.
> 
> The function there needs to be reviewed more, it seems to access
> potentially invalid memory when an AP sends other, too short,
> information elements.
> 
> --- a/drivers/net/wireless/libertas/scan.c
> +++ b/drivers/net/wireless/libertas/scan.c
> @@ -598,8 +598,8 @@ static int lbs_process_bss(struct bss_descriptor *bss,
>  
>  		switch (elem->id) {
>  		case MFIE_TYPE_SSID:
> -			bss->ssid_len = elem->len;
> -			memcpy(bss->ssid, elem->data, elem->len);
> +			bss->ssid_len = min_t(int, 32, elem->len);
> +			memcpy(bss->ssid, elem->data, bss->ssid_len);
>  			lbs_deb_scan("got SSID IE: '%s', len %u\n",
>  			             escape_essid(bss->ssid, bss->ssid_len),
>  			             bss->ssid_len);
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


      reply	other threads:[~2008-10-30  4:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-29 10:43 [PATCH] libertas: fix buffer overrun Johannes Berg
2008-10-30  4:10 ` Dan Williams [this message]

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=1225339853.32092.18.camel@localhost.localdomain \
    --to=dcbw@redhat.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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;
as well as URLs for NNTP newsgroup(s).