linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: bcm43xx-dev@lists.berlios.de
Cc: Stefano Brivio <stefano.brivio@polimi.it>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH] b43: fix use-after-free rfkill bug
Date: Sun, 13 Jan 2008 18:41:10 +0100	[thread overview]
Message-ID: <200801131841.10393.mb@bu3sch.de> (raw)
In-Reply-To: <20080113183014.675e64a3@morte>

On Sunday 13 January 2008 18:30:14 Stefano Brivio wrote:
> Fix rfkill code which caused a use-after-free bug.
> 
> Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
> ---
> Index: wireless-2.6/drivers/net/wireless/b43/rfkill.c
> ===================================================================
> --- wireless-2.6.orig/drivers/net/wireless/b43/rfkill.c
> +++ wireless-2.6/drivers/net/wireless/b43/rfkill.c
> @@ -138,8 +138,11 @@ void b43_rfkill_init(struct b43_wldev *d
>  	rfk->rfkill->user_claim_unsupported = 1;
>  
>  	rfk->poll_dev = input_allocate_polled_device();
> -	if (!rfk->poll_dev)
> -		goto err_free_rfk;
> +	if (!rfk->poll_dev) {
> +		rfkill_free(rfk->rfkill);
> +		goto err_freed_rfk;
> +	}
> +
>  	rfk->poll_dev->private = dev;
>  	rfk->poll_dev->poll = b43_rfkill_poll;
>  	rfk->poll_dev->poll_interval = 1000; /* msecs */
> @@ -175,8 +178,7 @@ err_unreg_rfk:
>  err_free_polldev:
>  	input_free_polled_device(rfk->poll_dev);
>  	rfk->poll_dev = NULL;
> -err_free_rfk:
> -	rfkill_free(rfk->rfkill);
> +err_freed_rfk:
>  	rfk->rfkill = NULL;
>  out_error:
>  	rfk->registered = 0;
> @@ -195,6 +197,5 @@ void b43_rfkill_exit(struct b43_wldev *d
>  	rfkill_unregister(rfk->rfkill);
>  	input_free_polled_device(rfk->poll_dev);
>  	rfk->poll_dev = NULL;
> -	rfkill_free(rfk->rfkill);
>  	rfk->rfkill = NULL;
>  }

Acked-by: Michael Buesch <mb@bu3sch.de>

-- 
Greetings Michael.

      reply	other threads:[~2008-01-13 17:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-13 17:30 [PATCH] b43: fix use-after-free rfkill bug Stefano Brivio
2008-01-13 17:41 ` Michael Buesch [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=200801131841.10393.mb@bu3sch.de \
    --to=mb@bu3sch.de \
    --cc=bcm43xx-dev@lists.berlios.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=stefano.brivio@polimi.it \
    /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).