mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Lieskovsky <jlieskov@redhat.com>
To: Cyrill Gorcunov <gorcunov@gmail.com>,
	Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
	Andrew Morton <akpm@linux-foundation.org>,
	Len Brown <len.brown@intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: thinkpad_acpi: fix possible NULL pointer dereference if kstrdup for ec_version_str failed
Date: Fri, 16 May 2008 11:34:09 +0200	[thread overview]
Message-ID: <1210930449.3812.15.camel@dhcp-lab-164.englab.brq.redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 369 bytes --]

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

[-- Attachment #2: kstrdup_ec_version_str.patch --]
[-- Type: text/x-patch, Size: 442 bytes --]

--- 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);
 }
 

             reply	other threads:[~2008-05-16  9:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-16  9:34 Jan Lieskovsky [this message]
2008-05-16 15:54 ` Henrique de Moraes Holschuh

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=1210930449.3812.15.camel@dhcp-lab-164.englab.brq.redhat.com \
    --to=jlieskov@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=gorcunov@gmail.com \
    --cc=hmh@hmh.eng.br \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.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®