diff -Nru makedumpfile-1.7.2/debian/changelog makedumpfile-1.7.2/debian/changelog --- makedumpfile-1.7.2/debian/changelog 2022-10-26 17:08:46.000000000 +0000 +++ makedumpfile-1.7.2/debian/changelog 2023-10-03 06:26:06.000000000 +0000 @@ -1,3 +1,11 @@ +makedumpfile (1:1.7.2-1ubuntu1) lunar; urgency=medium + + * d/p/lp2038248-fix-wrong-exclusion-of-slab-pages-on-Linux-6.2.patch: + When using the "makedumpfile -d 8" command, + exclude user data rather than other slab pages (LP: #2038248) + + -- Chengen Du Tue, 03 Oct 2023 06:26:06 +0000 + makedumpfile (1:1.7.2-1) unstable; urgency=medium * Update to new upstream version 1:1.7.2. diff -Nru makedumpfile-1.7.2/debian/patches/lp2038248-fix-wrong-exclusion-of-slab-pages-on-Linux-6.2.patch makedumpfile-1.7.2/debian/patches/lp2038248-fix-wrong-exclusion-of-slab-pages-on-Linux-6.2.patch --- makedumpfile-1.7.2/debian/patches/lp2038248-fix-wrong-exclusion-of-slab-pages-on-Linux-6.2.patch 1970-01-01 00:00:00.000000000 +0000 +++ makedumpfile-1.7.2/debian/patches/lp2038248-fix-wrong-exclusion-of-slab-pages-on-Linux-6.2.patch 2023-10-03 06:26:01.000000000 +0000 @@ -0,0 +1,72 @@ +From: Kazuhito Hagio +Date: Wed Dec 21 11:06:39 2022 +0900 +Subject: [PATCH] Fix wrong exclusion of slab pages on Linux 6.2-rc1 + +* Required for kernel 6.2 + +Kernel commit 130d4df57390 ("mm/sl[au]b: rearrange struct slab fields to +allow larger rcu_head"), which is contained in Linux 6.2-rc1 and later, +made the offset of slab.slabs equal to page.mapping's one. As a result, +"makedumpfile -d 8", which should exclude user data, excludes some slab +pages wrongly because isAnon() returns true when slab.slabs is an odd +number. With such dumpfiles, crash can fail to start session with an +error like this: + + # crash vmlinux dumpfile + ... + crash: page excluded: kernel virtual address: ffff8fa047ac2fe8 type: "xa_node shift" + +Make isAnon() check that the page is not slab to fix this. + +Signed-off-by: Kazuhito Hagio + +Bug-Ubuntu: https://bugs.launchpad.net/bugs/2038248 +Origin: upstream, https://github.com/makedumpfile/makedumpfile/commit/5f17bdd2128998a3eeeb4521d136a192222fadb6 + +--- makedumpfile-1.7.2.orig/makedumpfile.c ++++ makedumpfile-1.7.2/makedumpfile.c +@@ -6502,7 +6502,7 @@ __exclude_unnecessary_pages(unsigned lon + */ + else if ((info->dump_level & DL_EXCLUDE_CACHE) + && is_cache_page(flags) +- && !isPrivate(flags) && !isAnon(mapping)) { ++ && !isPrivate(flags) && !isAnon(mapping, flags)) { + pfn_counter = &pfn_cache; + } + /* +@@ -6510,7 +6510,7 @@ __exclude_unnecessary_pages(unsigned lon + */ + else if ((info->dump_level & DL_EXCLUDE_CACHE_PRI) + && is_cache_page(flags) +- && !isAnon(mapping)) { ++ && !isAnon(mapping, flags)) { + if (isPrivate(flags)) + pfn_counter = &pfn_cache_private; + else +@@ -6522,7 +6522,7 @@ __exclude_unnecessary_pages(unsigned lon + * - hugetlbfs pages + */ + else if ((info->dump_level & DL_EXCLUDE_USER_DATA) +- && (isAnon(mapping) || isHugetlb(compound_dtor))) { ++ && (isAnon(mapping, flags) || isHugetlb(compound_dtor))) { + pfn_counter = &pfn_user; + } + /* +--- makedumpfile-1.7.2.orig/makedumpfile.h ++++ makedumpfile-1.7.2/makedumpfile.h +@@ -161,12 +161,9 @@ test_bit(int nr, unsigned long addr) + #define isSwapBacked(flags) test_bit(NUMBER(PG_swapbacked), flags) + #define isHWPOISON(flags) (test_bit(NUMBER(PG_hwpoison), flags) \ + && (NUMBER(PG_hwpoison) != NOT_FOUND_NUMBER)) +- +-static inline int +-isAnon(unsigned long mapping) +-{ +- return ((unsigned long)mapping & PAGE_MAPPING_ANON) != 0; +-} ++#define isSlab(flags) test_bit(NUMBER(PG_slab), flags) ++#define isAnon(mapping, flags) (((unsigned long)mapping & PAGE_MAPPING_ANON) != 0 \ ++ && !isSlab(flags)) + + #define PTOB(X) (((unsigned long long)(X)) << PAGESHIFT()) + #define BTOP(X) (((unsigned long long)(X)) >> PAGESHIFT()) diff -Nru makedumpfile-1.7.2/debian/patches/series makedumpfile-1.7.2/debian/patches/series --- makedumpfile-1.7.2/debian/patches/series 2022-10-26 17:08:46.000000000 +0000 +++ makedumpfile-1.7.2/debian/patches/series 2023-10-03 06:25:21.000000000 +0000 @@ -1 +1,2 @@ 0002-adapt-makefile-to-debian.patch +lp2038248-fix-wrong-exclusion-of-slab-pages-on-Linux-6.2.patch