mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: Arjan van de Ven <arjan@infradead.org>
Cc: linux-kernel@vger.kernel.org, philipl@overt.org,
	akpm@linux-foundation.org
Subject: Re: [PATCH] acpi: close race in toshiba_acpi driver
Date: Fri, 28 Nov 2008 14:22:15 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0811281422070.3204@localhost.localdomain> (raw)
In-Reply-To: <20081128081909.65b7607a@infradead.org>

applied.

thanks,
-Len

On Fri, 28 Nov 2008, Arjan van de Ven wrote:

> 
> From 5d8af90c16de14f5d27c9d0b63118277941ebb4e Mon Sep 17 00:00:00 2001
> From: Arjan van de Ven <arjan@linux.intel.com>
> Date: Fri, 28 Nov 2008 08:14:14 -0800
> Subject: [PATCH] acpi: close race in toshiba_acpi driver
> 
> the toshiba ACPI driver will, in a failure case, free the rfkill state
> before stopping the polling timer that would use this state. More interesting,
> in the same failure case handling, it calls the exit function, which also
> frees the rfkill state, but after stopping the polling.
> 
> If the race happens, a NULL pointer is passed to rfkill_force_state()
> which then causes a nice dereference.
> 
> Fix the race by just not doing the too-early freeing of the rfkill state.
> 
> This appears to be the cause of a hot issue on kerneloops.org; while I
> have no solid evidence of that this patch will fix the issue, the race
> appears rather real.
> 
> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
> ---
>  drivers/acpi/toshiba_acpi.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
> index 66aac06..25f531d 100644
> --- a/drivers/acpi/toshiba_acpi.c
> +++ b/drivers/acpi/toshiba_acpi.c
> @@ -848,8 +848,6 @@ static int __init toshiba_acpi_init(void)
>  	ret = input_register_polled_device(toshiba_acpi.poll_dev);
>  	if (ret) {
>  		printk(MY_ERR "unable to register kill-switch input device\n");
> -		rfkill_free(toshiba_acpi.rfk_dev);
> -		toshiba_acpi.rfk_dev = NULL;
>  		toshiba_acpi_exit();
>  		return ret;
>  	}
> -- 
> 1.6.0.4
> 
> 
> -- 
> Arjan van de Ven 	Intel Open Source Technology Centre
> For development, discussion and tips for power savings, 
> visit http://www.lesswatts.org
> 

      reply	other threads:[~2008-11-28 19:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-28 16:19 Arjan van de Ven
2008-11-28 19:22 ` Len Brown [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=alpine.LFD.2.00.0811281422070.3204@localhost.localdomain \
    --to=lenb@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philipl@overt.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®