[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120205220951.334100926@pcw.home.local>
Date: Sun, 05 Feb 2012 23:10:33 +0100
From: Willy Tarreau <w@....eu>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Rajiv Andrade <srajiv@...ux.vnet.ibm.com>,
James Morris <jmorris@...ei.org>,
Greg KH <gregkh@...uxfoundation.org>
Subject: [PATCH 44/91] TPM: Zero buffer after copying to userspace
2.6.27-longterm review patch. If anyone has any objections, please let us know.
------------------
commit 3321c07ae5068568cd61ac9f4ba749006a7185c9 upstream.
Since the buffer might contain security related data it might be a good idea to
zero the buffer after we have copied it to userspace.
This got assigned CVE-2011-1162.
Signed-off-by: Rajiv Andrade <srajiv@...ux.vnet.ibm.com>
Signed-off-by: James Morris <jmorris@...ei.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
drivers/char/tpm/tpm.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
Index: longterm-2.6.27/drivers/char/tpm/tpm.c
===================================================================
--- longterm-2.6.27.orig/drivers/char/tpm/tpm.c 2012-02-05 22:34:40.951915689 +0100
+++ longterm-2.6.27/drivers/char/tpm/tpm.c 2012-02-05 22:34:41.090914667 +0100
@@ -1069,6 +1069,7 @@
{
struct tpm_chip *chip = file->private_data;
ssize_t ret_size;
+ int rc;
del_singleshot_timer_sync(&chip->user_read_timer);
flush_scheduled_work();
@@ -1079,8 +1080,11 @@
ret_size = size;
mutex_lock(&chip->buffer_mutex);
- if (copy_to_user(buf, chip->data_buffer, ret_size))
+ rc = copy_to_user(buf, chip->data_buffer, ret_size);
+ memset(chip->data_buffer, 0, ret_size);
+ if (rc)
ret_size = -EFAULT;
+
mutex_unlock(&chip->buffer_mutex);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists