Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Leach <matthew.leach@arm.com>
To: kexec@lists.infradead.org
Cc: Matthew Leach <matthew.leach@arm.com>, will.deacon@arm.com
Subject: [RFC PATCH 1/4] Fix an overflow bug with address comparison
Date: Wed,  5 Sep 2012 12:44:00 +0100	[thread overview]
Message-ID: <1346845443-32242-2-git-send-email-matthew.leach@arm.com> (raw)
In-Reply-To: <1346845443-32242-1-git-send-email-matthew.leach@arm.com>

The variables mstart and mend are assigned the values of
mem_region[i].start and mem_region[i].end which are of the type
unsigned long long. Ensure that mstart and mend are of the same data
type to prevent address overflow.

Signed-off-by: Matthew Leach <matthew.leach@arm.com>
---
 kexec/kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kexec/kexec.c b/kexec/kexec.c
index 8928be0..c7b38e3 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -108,7 +108,7 @@ int valid_memory_range(struct kexec_info *info,
 		return 0;
 	}
 	for (i = 0; i < info->memory_ranges; i++) {
-		unsigned long mstart, mend;
+		unsigned long long mstart, mend;
 		/* Only consider memory ranges */
 		if (info->memory_range[i].type != RANGE_RAM)
 			continue;
-- 
1.7.12


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2012-09-05 11:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 11:43 [RFC PATCH 0/4] Add device-tree support to kexec-tools for ARM Matthew Leach
2012-09-05 11:44 ` Matthew Leach [this message]
2012-09-05 11:44 ` [RFC PATCH 2/4] Move libfdt to a generic location Matthew Leach
2012-09-05 11:44 ` [RFC PATCH 3/4] Add the dtc for device-tree manipulation Matthew Leach
2012-09-05 11:44 ` [RFC PATCH 4/4] Add device tree support to the ARM platform Matthew Leach
2012-09-05 12:38 ` [RFC PATCH 0/4] Add device-tree support to kexec-tools for ARM Simon Horman
2012-09-05 14:34   ` Matthew Leach
2012-09-06  3:29     ` Simon Horman
2012-09-06  9:01       ` Will Deacon
2012-09-06  9:09         ` Simon Horman
2012-09-06  9:14           ` Will Deacon
2012-09-06 22:03             ` Simon Horman
2012-09-06 11:04       ` Matthew Leach
2012-09-06 11:19         ` Will Deacon
2012-09-06 22:00         ` Simon Horman

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=1346845443-32242-2-git-send-email-matthew.leach@arm.com \
    --to=matthew.leach@arm.com \
    --cc=kexec@lists.infradead.org \
    --cc=will.deacon@arm.com \
    /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