mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: J Freyensee <james_p_freyensee@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 5/9] pti: double-free security PTI fix
Date: Tue, 28 Jun 2011 09:02:02 -0700	[thread overview]
Message-ID: <1309276926-1327-5-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <1309276926-1327-1-git-send-email-gregkh@suse.de>

From: J Freyensee <james_p_freyensee@linux.intel.com>

This patch fixes a double-free error that will not always be
seen unless /dev/pti char interface is stressed.

Signed-off-by: J Freyensee <james_p_freyensee@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/misc/pti.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/pti.c b/drivers/misc/pti.c
index bb6f925..be48573 100644
--- a/drivers/misc/pti.c
+++ b/drivers/misc/pti.c
@@ -317,7 +317,8 @@ EXPORT_SYMBOL_GPL(pti_request_masterchannel);
  *				a master, channel ID address
  *				used to write to PTI HW.
  *
- * @mc: master, channel apeture ID address to be released.
+ * @mc: master, channel apeture ID address to be released.  This
+ *      will de-allocate the structure via kfree().
  */
 void pti_release_masterchannel(struct pti_masterchannel *mc)
 {
@@ -581,7 +582,7 @@ static int pti_char_open(struct inode *inode, struct file *filp)
 static int pti_char_release(struct inode *inode, struct file *filp)
 {
 	pti_release_masterchannel(filp->private_data);
-	kfree(filp->private_data);
+	filp->private_data = NULL;
 	return 0;
 }
 
-- 
1.7.5.4


  parent reply	other threads:[~2011-06-28 16:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-28 15:39 [GIT PATCH] driver core fixes for 3.0 Greg KH
2011-06-28 16:01 ` [PATCH 1/9] firmware: fix GOOGLE_SMI kconfig dependency warning Greg Kroah-Hartman
2011-06-28 16:01   ` [PATCH 2/9] st_kim: Handle case of no device found for ID 0 Greg Kroah-Hartman
2011-06-28 16:02   ` [PATCH 3/9] drivers/base/platform.c: don't mark platform_device_register_resndata() as __init_or_module Greg Kroah-Hartman
2011-06-28 16:02   ` [PATCH 4/9] drivers:misc: ti-st: fix skipping of change remote baud Greg Kroah-Hartman
2011-06-28 16:02   ` Greg Kroah-Hartman [this message]
2011-06-28 16:02   ` [PATCH 6/9] pti: ENXIO error case memory leak PTI fix Greg Kroah-Hartman
2011-06-28 16:02   ` [PATCH 7/9] pti: PTI semantics fix in pti_tty_cleanup Greg Kroah-Hartman

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=1309276926-1327-5-git-send-email-gregkh@suse.de \
    --to=gregkh@suse.de \
    --cc=james_p_freyensee@linux.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®