1 Star 0 Fork 46

chengquan/kexec-tools

forked from src-openEuler/kexec-tools 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-header-offset-overflow-when-large-pfn.patch 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
chengquan 提交于 2020-05-12 11:12 +08:00 . Update software to v2.0.20
From bde6d1f1d3f9551fa4ca65247e210c8ac7814168 Mon Sep 17 00:00:00 2001
From: Jialong Chen <chenjialong@huawei.com>
Date: Tue, 3 Dec 2019 20:26:55 +0000
Subject: [PATCH] fix header offset overflow when large pfn
info->len_bitmap=0x182000000
dh->bitmap_blocks * dh->block_size = info->len_bitmap=0x182000000 > int range
so:
cd_header->offset = (DISKDUMP_HEADER_BLOCKS + dh->sub_hdr_size + dh->bitmap_blocks) * dh->block_size;
get cd_header->offset = 0x82015000, but correct size is 0x182015000
so we set DISKDUMP_HEADER_BLOCKS to 1UL.
when cd_header->offset overflow, and cd_page->offset get an error offset.
cd_page->offset = cd_header->offset + sizeof(page_desc_t)*info->num_dumpable
later write page data will cover bitmap2.
Signed-off-by: Jialong Chen <chenjialong@huawei.com>
---
makedumpfile-1.6.4/diskdump_mod.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/makedumpfile-1.6.7/diskdump_mod.h b/makedumpfile-1.6.7/diskdump_mod.h
index 2676817..3733953 100644
--- a/makedumpfile-1.6.7/diskdump_mod.h
+++ b/makedumpfile-1.6.7/diskdump_mod.h
@@ -22,7 +22,7 @@
#define DISK_DUMP_SIGNATURE "DISKDUMP"
#define KDUMP_SIGNATURE "KDUMP "
#define SIG_LEN (sizeof(DUMP_PARTITION_SIGNATURE) - 1)
-#define DISKDUMP_HEADER_BLOCKS (1)
+#define DISKDUMP_HEADER_BLOCKS (1UL)
/*
* These are all remnants of the old "diskdump" facility,
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chengquanspace/kexec-tools.git
git@gitee.com:chengquanspace/kexec-tools.git
chengquanspace
kexec-tools
kexec-tools
master

搜索帮助