Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] makedumpfile: fix a segmentation fault when pfn exceeds 2G boundary
@ 2014-04-14 10:35 Jingbai Ma
  2014-04-15  1:15 ` HATAYAMA Daisuke
  0 siblings, 1 reply; 5+ messages in thread
From: Jingbai Ma @ 2014-04-14 10:35 UTC (permalink / raw)
  To: kumagai-atsushi; +Cc: d.hatayama, kexec, lisa.mitchell

This patch intend to fix a segmentation fault when pfn exceeds 2G boundary.

In function is_on(), if the pfn (i) is greater than 2G, it will be a negative
value and will cause a segmentation fault.
is_on(char *bitmap, int i)
{
        return bitmap[i>>3] & (1 << (i & 7));
}


Signed-off-by: Jingbai Ma <jingbai.ma@hp.com>
---
 makedumpfile.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/makedumpfile.h b/makedumpfile.h
index 3d270c6..03d35a8 100644
--- a/makedumpfile.h
+++ b/makedumpfile.h
@@ -1591,7 +1591,7 @@ int get_xen_info_ia64(void);
 #endif	/* s390x */
 
 static inline int
-is_on(char *bitmap, int i)
+is_on(char *bitmap, unsigned long long i)
 {
 	return bitmap[i>>3] & (1 << (i & 7));
 }


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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-17  4:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-14 10:35 [PATCH] makedumpfile: fix a segmentation fault when pfn exceeds 2G boundary Jingbai Ma
2014-04-15  1:15 ` HATAYAMA Daisuke
2014-04-15  8:07   ` HATAYAMA Daisuke
2014-04-15 10:32     ` Jingbai Ma
2014-04-17  4:53       ` Atsushi Kumagai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox