[patch 6/8] kernel/resource.c: fix sign extension in reserve_setup()

From: Greg KH
Date: Fri Jul 17 2009 - 16:41:27 EST


2.6.27-stable review patch. If anyone has any objections, please let us know.

------------------

From: Zhang Rui <rui.zhang@xxxxxxxxx>

commit 8bc1ad7dd301b7ca7454013519fa92e8c53655ff upstream.

When the 32-bit signed quantities get assigned to the u64 resource_size_t,
they are incorrectly sign-extended.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=13253
Addresses http://bugzilla.kernel.org/show_bug.cgi?id=9905

Signed-off-by: Zhang Rui <rui.zhang@xxxxxxxxx>
Reported-by: Leann Ogasawara <leann@xxxxxxxxxx>
Cc: Pierre Ossman <drzeus@xxxxxxxxx>
Reported-by: <pablomme@xxxxxxxxxxxxxx>
Tested-by: <pablomme@xxxxxxxxxxxxxx>
Cc: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
kernel/resource.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -741,7 +741,7 @@ static int __init reserve_setup(char *st
static struct resource reserve[MAXRESERVE];

for (;;) {
- int io_start, io_num;
+ unsigned int io_start, io_num;
int x = reserved;

if (get_option (&str, &io_start) != 2)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/