[PATCH] makedumpfile: fix a segmentation fault when pfn exceeds 2G boundary

Jingbai Ma jingbai.ma at hp.com
Mon Apr 14 03:35:44 PDT 2014


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 at 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));
 }




More information about the kexec mailing list