commit b80b16549e24769c7d5fe3a10c4b1a1c4b5161f3 Author: Dave Anderson Date: Mon Mar 23 15:52:11 2020 -0400 Fix for reading compressed kdump dumpfiles from systems with physical memory located at extraordinarily high addresses. In a system with a physical address range from 0x602770ecf000 to 0x6027ffffffff, the crash utility fails during session initialization due to an integer overflow, ending with the error message "crash: vmlinux and vmcore do not match!". (chenjialong@huawei.com) diff --git crash-7.2.8/diskdump.c crash-7.2.8/diskdump.c index e88243e616cc..328c932dad5a 100644 --- crash-7.2.8/diskdump.c +++ crash-7.2.8/diskdump.c @@ -233,7 +233,7 @@ clean_diskdump_data(void) } static inline int -get_bit(char *map, int byte, int bit) +get_bit(char *map, unsigned long byte, int bit) { return map[byte] & (1<max_mapnr = header->max_mapnr; /* read memory bitmap */ - bitmap_len = block_size * header->bitmap_blocks; + bitmap_len = (off_t)block_size * header->bitmap_blocks; dd->bitmap_len = bitmap_len; offset = (off_t)block_size * (1 + header->sub_hdr_size); @@ -744,7 +744,7 @@ restart: memcpy(dd->dumpable_bitmap, dd->bitmap, bitmap_len); dd->data_offset - = (1 + header->sub_hdr_size + header->bitmap_blocks) + = (1UL + header->sub_hdr_size + header->bitmap_blocks) * header->block_size; dd->header = header;