[patch 05/73] ACPI: video_device_list corruption

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg KH
Date: Wednesday, February 6, 2008 - 4:51 pm

2.6.23-stable review patch.  If anyone has any objections, please let us know.
------------------
From: William Lee Irwin III <wli@holomorphy.com>

The ->cap fields of struct acpi_video_device and struct acpi_video_bus
are 1B each, not 4B. The oversized memset()'s corrupted the subsequent
list_head fields. This resulted in silent corruption without
CONFIG_DEBUG_LIST and BUG's with it. This patch uses sizeof() to pass
the proper bounds to the memset() calls and thereby correct the bugs.

upstream commit 98934def70b48dac74fac3738b78ab2d1a28edda

Signed-off-by: William Irwin <wli@holomorphy.com>
Acked-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/acpi/video.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -573,7 +573,7 @@ static void acpi_video_device_find_cap(s
 	struct acpi_video_device_brightness *br = NULL;
 
 
-	memset(&device->cap, 0, 4);
+	memset(&device->cap, 0, sizeof(device->cap));
 
 	if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_ADR", &h_dummy1))) {
 		device->cap._ADR = 1;
@@ -693,7 +693,7 @@ static void acpi_video_bus_find_cap(stru
 {
 	acpi_handle h_dummy1;
 
-	memset(&video->cap, 0, 4);
+	memset(&video->cap, 0, sizeof(video->cap));
 	if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOS", &h_dummy1))) {
 		video->cap._DOS = 1;
 	}

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/73] 2.6.23-stable review, Greg KH, (Wed Feb 6, 4:50 pm)
[patch 03/73] dm crypt: fix write endio, Greg KH, (Wed Feb 6, 4:50 pm)
[patch 04/73] dm crypt: use bio_add_page, Greg KH, (Wed Feb 6, 4:50 pm)
[patch 05/73] ACPI: video_device_list corruption, Greg KH, (Wed Feb 6, 4:51 pm)
[patch 14/73] sky2: RX lockup fix, Greg KH, (Wed Feb 6, 4:51 pm)
[patch 16/73] X25: Add missing x25_neigh_put, Greg KH, (Wed Feb 6, 4:51 pm)
[patch 28/73] CASSINI: Fix endianness bug., Greg KH, (Wed Feb 6, 4:52 pm)
[patch 45/73] chelsio: Fix skb-&gt;dev setting, Greg KH, (Wed Feb 6, 4:53 pm)
[patch 46/73] cxgb: fix T2 GSO, Greg KH, (Wed Feb 6, 4:53 pm)
[patch 47/73] cxgb: fix stats, Greg KH, (Wed Feb 6, 4:53 pm)
[patch 55/73] m68k: Export cachectl.h, Greg KH, (Wed Feb 6, 4:53 pm)
[patch 64/73] spi: omap2_mcspi PIO RX fix, Greg KH, (Wed Feb 6, 4:54 pm)
[patch 66/73] fix oops on rmmod capidrv, Greg KH, (Wed Feb 6, 4:54 pm)
[patch 70/73] forcedeth: mac address mcp77/79, Greg KH, (Wed Feb 6, 4:54 pm)
[patch 71/73] atl1: fix frame length bug, Greg KH, (Wed Feb 6, 4:54 pm)
[patch 72/73] ACPI: sync blacklist w/ latest, Greg KH, (Wed Feb 6, 4:54 pm)
[patch 73/73] PCI: Fix fakephp deadlock, Greg KH, (Wed Feb 6, 4:54 pm)
Re: [stable] [patch 00/73] 2.6.23-stable review, Greg KH, (Thu Feb 7, 10:31 pm)