linux-kernel-test/drivers/platform/x86
Costantino Leandro f3d83e2415 wmi: fix kernel panic when stack protection enabled.
Summary:
Kernel panic arise when stack protection is enabled, since strncat will
add a null terminating byte '\0'; So in functions
like this one (wmi_query_block):
        char wc[4]="WC";
	....
	strncat(method, block->object_id, 2);
        ...
the length of wc should be n+1 (wc[5]) or stack protection
fault will arise. This is not noticeable when stack protection is
disabled,but , isn't good either.
Config used: [CONFIG_CC_STACKPROTECTOR_ALL=y,
	      CONFIG_CC_STACKPROTECTOR=y]

Panic Trace
------------
       .... stack-protector: kernel stack corrupted in : fa7b182c
       2.6.30-rc8-obelisco-generic
       call_trace:
           [<c04a6c40>] ? panic+0x45/0xd9
	   [<c012925d>] ? __stack_chk_fail+0x1c/0x40
	   [<fa7b182c>] ? wmi_query_block+0x15a/0x162 [wmi]
	   [<fa7b182c>] ? wmi_query_block+0x15a/0x162 [wmi]
	   [<fa7e7000>] ? acer_wmi_init+0x00/0x61a [acer_wmi]
	   [<fa7e7135>] ? acer_wmi_init+0x135/0x61a [acer_wmi]
	   [<c0101159>] ? do_one_initcall+0x50+0x126

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=13514

Signed-off-by: Costantino Leandro <lcostantino@gmail.com>
Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Len Brown <len.brown@intel.com>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-08-26 20:06:53 -07:00
..
acer-wmi.c acer-wmi: fix rfkill conversion 2009-07-21 15:58:54 -04:00
acerhdf.c acerhdf: Acer Aspire One fan control 2009-06-24 00:58:16 -04:00
asus_acpi.c ACPI: asus-acpi: use .notify method instead of installing handler directly 2009-06-18 00:13:15 -04:00
asus-laptop.c asus-laptop: use pr_fmt and pr_<level> 2009-06-24 01:31:38 -04:00
compal-laptop.c create drivers/platform/x86/ from drivers/misc/ 2008-12-19 04:42:32 -05:00
dell-laptop.c dell-laptop: fix rfkill conversion 2009-06-15 15:05:58 -04:00
dell-wmi.c dell-wmi: don't generate errors on empty messages 2009-06-17 23:44:22 -04:00
eeepc-laptop.c eeepc-laptop: fix hot-unplug on resume 2009-08-02 12:35:53 -04:00
fujitsu-laptop.c fujitsu-laptop: use .notify method instead of installing hotkey handler directly 2009-04-07 16:26:58 -04:00
hp-wmi.c hp-wmi: check that an input device exists in resume handler 2009-07-30 17:16:05 -04:00
intel_menlow.c thermal: use integers rather than strings for thermal values 2009-02-20 10:52:37 -05:00
Kconfig thinkpad-acpi: remove dock and bay subdrivers 2009-08-01 23:46:58 -04:00
Makefile acerhdf: Acer Aspire One fan control 2009-06-24 00:58:16 -04:00
msi-laptop.c create drivers/platform/x86/ from drivers/misc/ 2008-12-19 04:42:32 -05:00
panasonic-laptop.c Merge branches 'release', 'APERF', 'ARAT', 'misc', 'kelvin', 'device-lock' and 'bjorn.notify' into release 2009-04-07 18:18:42 -04:00
sony-laptop.c sony: fix rfkill code again 2009-06-15 15:05:51 -04:00
tc1100-wmi.c tc1100-wmi: Fix state reporting 2009-04-03 12:03:27 -04:00
thinkpad_acpi.c thinkpad-acpi: fix incorrect use of TPACPI_BRGHT_MODE_ECNVRAM 2009-08-01 23:55:53 -04:00
toshiba_acpi.c rfkill: rewrite 2009-06-03 14:06:13 -04:00
wmi.c wmi: fix kernel panic when stack protection enabled. 2009-08-26 20:06:53 -07:00