]> git.baikalelectronics.ru Git - kernel.git/commit
toshiba_acpi: close race in toshiba_acpi driver
authorArjan van de Ven <arjan@linux.intel.com>
Fri, 28 Nov 2008 16:19:09 +0000 (08:19 -0800)
committerLen Brown <len.brown@intel.com>
Fri, 28 Nov 2008 19:21:53 +0000 (14:21 -0500)
commitcba562e559527c6231fd13e926fd1447eff0a72a
tree1aa4d01e2cb47718228e042ce600ebbbaba02aea
parentad6422c88ce40aa0e75103b6debfbe824bcb66a1
toshiba_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>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/toshiba_acpi.c