lkml.org 
[lkml]   [2008]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subjectthinkpad_acpi: fix possible NULL pointer dereference if kstrdup for ec_version_str failed
From
Date
Hello guys,

apologize for bothering you if wrong, but based on patch from Cyrill:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=90fe17f4df2f830601ffd422b11d1f7f9a9d0355

There is a potential NULL pointer dereference in thinkpad_acpi_module_exit() -- in case,
kstrdup for thinkpad_id.ec_version_str failed.

Kind regards
Jan Lieskovsky
--- linux-2.6.25.3.old/drivers/misc/thinkpad_acpi.c 2008-05-12 11:43:16.000000000 +0200
+++ linux-2.6.25.3/drivers/misc/thinkpad_acpi.c 2008-05-16 11:20:48.000000000 +0200
@@ -6072,7 +6072,8 @@
remove_proc_entry(TPACPI_PROC_DIR, acpi_root_dir);

kfree(thinkpad_id.bios_version_str);
- kfree(thinkpad_id.ec_version_str);
+ if (thinkpad_id.ec_version_str)
+ kfree(thinkpad_id.ec_version_str);
kfree(thinkpad_id.model_str);
}
\
 
 \ /
  Last update: 2008-05-16 11:35    [W:0.054 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site