incoming
Subsystems (7)
Andrew Morton
maintainer5 fixes, based on 444fc5cde64330661bf59944c43844e7d4c2ccd8:
Qian Cai <[email protected]>:
mm/z3fold: silence kmemleak false positives of slots
Hugh Dickins <[email protected]>:
mm,thp: stop leaking unreleased file pages
Konstantin Khlebnikov <[email protected]>:
mm: remove VM_BUG_ON(PageSlab()) from page_mapcount()
Alexander Potapenko <[email protected]>:
fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()
Arnd Bergmann <[email protected]>:
include/asm-generic/topology.h: guard cpumask_of_node() macro argument
fs/binfmt_elf.c | 2 +- include/asm-generic/topology.h | 2 +- include/linux/mm.h | 19 +++++++++++++++---- mm/khugepaged.c | 1 + mm/z3fold.c | 3 +++ 5 files changed, 21 insertions(+), 6 deletions(-)
Andrew Morton
maintainerPATCH 1/5 mm/z3fold: silence kmemleak false positives of slots
From: Qian Cai <[email protected]>
Subject: mm/z3fold: silence kmemleak false positives of slots
Kmemleak reported many leaks while under memory pressue in,
slots = alloc_slots(pool, gfp);
which is referenced by "zhdr" in init_z3fold_page(),
zhdr->slots = slots;
However, "zhdr" could be gone without freeing slots as the later will be freed separately when the last "handle" off of "handles" array is freed. It will be within "slots" which is always aligned.
unreferenced object 0xc000000fdadc1040 (size 104):
comm "oom04", pid 140476, jiffies 4295359280 (age 3454.970s) hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<00000000d1f0f5eb>] z3fold_zpool_malloc+0x7b0/0xe10
alloc_slots at mm/z3fold.c:214
(inlined by) init_z3fold_page at mm/z3fold.c:412
(inlined by) z3fold_alloc at mm/z3fold.c:1161
(inlined by) z3fold_zpool_malloc at mm/z3fold.c:1735
[<0000000064a2e969>] zpool_malloc+0x34/0x50
[<00000000af63e491>] zswap_frontswap_store+0x60c/0xda0
zswap_frontswap_store at mm/zswap.c:1093
[<00000000af5e07e0>] __frontswap_store+0x128/0x330
[<00000000de2f582b>] swap_writepage+0x58/0x110
[<000000000120885f>] pageout+0x16c/0xa40
[<00000000444c1f68>] shrink_page_list+0x1ac8/0x25c0
[<00000000d19e8610>] shrink_inactive_list+0x270/0x730
[<00000000e17df726>] shrink_lruvec+0x444/0xf30
[<000000005f02ab35>] shrink_node+0x2a4/0x9c0
[<00000000014cabbd>] do_try_to_free_pages+0x158/0x640
[<00000000dcfaba07>] try_to_free_pages+0x1bc/0x5f0
[<00000000fa207ab8>] __alloc_pages_slowpath.constprop.60+0x4dc/0x15a0
[<000000003669f1d2>] __alloc_pages_nodemask+0x520/0x650
[<0000000011fa4168>] alloc_pages_vma+0xc0/0x420
[<0000000098b376f2>] handle_mm_fault+0x1174/0x1bf0---
mm/z3fold.c | 3 +++ 1 file changed, 3 insertions(+)
mm/z3fold.c renamed from mm/z3fold.c~mm-z3fold-silence-kmemleak-false-positives-of-slots +3 -0
@@ -43,6 +43,7 @@#include <linux/spinlock.h> #include <linux/zpool.h> #include <linux/magic.h> +#include <linux/kmemleak.h> /* * NCHUNKS_ORDER determines the internal allocation granularity, effectively
@@ -215,6 +216,8 @@ static inline struct z3fold_buddy_slots (gfp & ~(__GFP_HIGHMEM | __GFP_MOVABLE)));if (slots) { +/* It will be freed separately in free_handle(). */ +kmemleak_not_leak (slots);memset (slots->slot,0 ,sizeof (slots->slot)); slots->pool = (unsigned long )pool;rwlock_init (&slots->lock);
_
Andrew Morton
maintainerPATCH 2/5 mm,thp: stop leaking unreleased file pages
In reply to Andrew MortonFrom: Hugh Dickins <[email protected]>
Subject: mm,thp: stop leaking unreleased file pages
When collapse_file() calls try_to_release_page(), it has already isolated the page: so if releasing buffers happens to fail (as it sometimes does), remember to putback_lru_page(): otherwise that page is left unreclaimable and unfreeable, and the file extent uncollapsible.
---
mm/khugepaged.c | 1 + 1 file changed, 1 insertion(+)
mm/khugepaged.c renamed from mm/khugepaged.c~mmthp-stop-leaking-unreleased-file-pages +1 -0
@@ -1692,6 +1692,7 @@ static void collapse_file(struct mm_struif (page_has_private (page) && !try_to_release_page (page,GFP_KERNEL )) { result =SCAN_PAGE_HAS_PRIVATE ; +putback_lru_page (page); goto out_unlock; }
_
Andrew Morton
maintainerPATCH 3/5 mm: remove VM_BUG_ON(PageSlab()) from page_mapcount()
In reply to Andrew MortonFrom: Konstantin Khlebnikov <[email protected]>
Subject: mm: remove VM_BUG_ON(PageSlab()) from page_mapcount()
Replace superfluous VM_BUG_ON() with comment about correct usage.
Technically reverts commit 1d148e218a0d0566b1c06f2f45f1436d53b049b2 ("mm: add VM_BUG_ON_PAGE() to page_mapcount()"), but context have changed.
Function isolate_migratepages_block() runs some checks out of lru_lock when choose pages for migration. After checking PageLRU() it checks extra page references by comparing page_count() and page_mapcount(). Between these two checks page could be removed from lru, freed and taken by slab.
As a result this race triggers VM_BUG_ON(PageSlab()) in page_mapcount(). Race window is tiny. For certain workload this happens around once a year.
page:ffffea0105ca9380 count:1 mapcount:0 mapping:ffff88ff7712c180 index:0x0 compound_mapcount: 0
flags: 0x500000000008100(slab|head)
raw: 0500000000008100 dead000000000100 dead000000000200 ffff88ff7712c180 raw: 0000000000000000 0000000080200020 00000001ffffffff 0000000000000000 page dumped because: VM_BUG_ON_PAGE(PageSlab(page)) ------------[ cut here ]------------ kernel BUG at ./include/linux/mm.h:628! invalid opcode: 0000 [#1] SMP NOPTI CPU: 77 PID: 504 Comm: kcompactd1 Tainted: G W 4.19.109-27 #1 Hardware name: Yandex T175-N41-Y3N/MY81-EX0-Y3N, BIOS R05 06/20/2019 RIP: 0010:isolate_migratepages_block+0x986/0x9b0
Code in isolate_migratepages_block() was added in commit 119d6d59dcc0 ("mm, compaction: avoid isolating pinned pages") before adding VM_BUG_ON into page_mapcount().
This race has been predicted in 2015 by Vlastimil Babka (see link below).
---
include/linux/mm.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
include/linux/mm.h renamed from include/linux/mm.h~mm-remove-vm_bug_onpageslab-from-page_mapcount +13 -1
@@ -782,6 +782,11 @@ static inline void *kvcalloc(size_t n, sextern void kvfree (const void *addr); +/* +* Mapcount of compound page as a whole, does not include mapped sub-pages. +* +* Must be called only for compound pages or any their tail sub-pages. +*/ static inline int compound_mapcount (struct page *page) {VM_BUG_ON_PAGE (!PageCompound (page), page);
@@ -801,10 +806,16 @@ static inline void page_mapcount_reset(sint __page_mapcount (struct page *page); +/* +* Mapcount of 0-order page; when compound sub-page, includes +* compound_mapcount(). +* +* Result is undefined for pages which cannot be mapped into userspace. +* For example SLAB or special types of pages. See function page_has_type(). +* They use this place in struct page differently. +*/ static inline int page_mapcount (struct page *page) { -VM_BUG_ON_PAGE (PageSlab (page), page);
Andrew Morton
maintainerPATCH 4/5 fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()
In reply to Andrew MortonFrom: Alexander Potapenko <[email protected]>
Subject: fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()
KMSAN reported uninitialized data being written to disk when dumping core. As a result, several kilobytes of kmalloc memory may be written to the core file and then read by a non-privileged user.
---
fs/binfmt_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/binfmt_elf.c renamed from fs/binfmt_elf.c~fs-binfmt_elfc-allocate-initialized-memory-in-fill_thread_core_info +1 -1
@@ -1733,7 +1733,7 @@ static int fill_thread_core_info(struct (!regset->active || regset->active(t->task, regset) > 0)) {int ret;size_t size =regset_size (t->task, regset); -void *data =kmalloc (size,GFP_KERNEL ); +void *data =kzalloc (size,GFP_KERNEL );if (unlikely (!data))return 0 ; ret = regset->get(t->task, regset,
_
Sasha Levin
maintainerRe: [patch 4/5] fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()
Hi
[This is an automated email]
This commit has been processed because it contains a -stable tag. The stable tag indicates that it's relevant for the following trees: all
The bot has tested the following trees: v5.6.14, v5.4.42, v4.19.124, v4.14.181, v4.9.224, v4.4.224.
v5.6.14: Build OK!
v5.4.42: Build OK!
v4.19.124: Build OK!
v4.14.181: Failed to apply! Possible dependencies:
27e64b4be4b8 ("regset: Add support for dynamically sized regsets")
v4.9.224: Failed to apply! Possible dependencies:
27e64b4be4b8 ("regset: Add support for dynamically sized regsets")
v4.4.224: Failed to apply! Possible dependencies:
27e64b4be4b8 ("regset: Add support for dynamically sized regsets") 90954e7b9407 ("x86/coredump: Use pr_reg size, rather that TIF_IA32 flag")
NOTE: The patch will not be queued to stable trees until it is upstream.
How should we proceed with this patch?
Signature · 2 lines
Thanks Sasha
Andrew Morton
maintainerPATCH 5/5 include/asm-generic/topology.h: guard cpumask_of_node() macro argument
In reply to Andrew MortonFrom: Arnd Bergmann <[email protected]>
Subject: include/asm-generic/topology.h: guard cpumask_of_node() macro argument
drivers/hwmon/amd_energy.c:195:15: error: invalid operands to binary expression ('void' and 'int')
(channel - data->nr_cpus));
~~~~~~~~~^~~~~~~~~~~~~~~~~
include/asm-generic/topology.h:51:42: note: expanded from macro 'cpumask_of_node'
#define cpumask_of_node(node) ((void)node, cpu_online_mask)
^~~~
include/linux/cpumask.h:618:72: note: expanded from macro 'cpumask_first_and'
#define cpumask_first_and(src1p, src2p) cpumask_next_and(-1, (src1p), (src2p))
^~~~~---
include/asm-generic/topology.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/asm-generic/topology.h renamed from include/asm-generic/topology.h~cpumask-guard-cpumask_of_node-macro-argument +1 -1
@@ -48,7 +48,7 @@#ifdef CONFIG_NEED_MULTIPLE_NODES #define cpumask_of_node (node) ((node) == 0 ? cpu_online_mask : cpu_none_mask)#else -#define cpumask_of_node (node) ((void)node, cpu_online_mask) +#define cpumask_of_node (node) ((void)(node), cpu_online_mask)#endif #endif #ifndef pcibus_to_node
_
[alternative-merged] add-kernel-config-option-for-twisting-kernel-behavior.patch removed from -mm tree
In reply to Andrew MortonThe patch titled Subject: add kernel config option for twisting kernel behavior. has been removed from the -mm tree. Its filename was add-kernel-config-option-for-twisting-kernel-behavior.patch
The patch titled
Subject: add kernel config option for twisting kernel behavior.
has been removed from the -mm tree. Its filename was
add-kernel-config-option-for-twisting-kernel-behavior.patch
This patch was dropped because an alternative patch was merged
------------------------------------------------------
From: Tetsuo Handa <[email protected]>
Subject: add kernel config option for twisting kernel behavior.
Existing kernel config options are defined based on "whether you want to enable this module/feature or not". And such granularity is sometimes too rough-grained for fuzzing tools which try to find bugs inside each module/feature.
While syzkaller (one of fuzzing tools) is finding many bugs, sometimes syzkaller examines stupid operations. Some examples of such operations
are: changing console loglevel which in turn makes it impossible to get kernel messages when a crash happens, freezing filesystems which in turn causes khungtaskd to needlessly complain, programmatically sending Ctrl-Alt-Del which in turn causes the system to needlessly reboot. Currently we prevent syzkaller from examining stupid operations by blacklisting syscall arguments and/or disabling whole functionality using existing kernel config options. But such approach is difficult to maintain and needlessly prevents fuzzers from testing kernel code. [1]
We want fuzzers to test as much coverage as possible while we want fuzzers not to try stupid operations. To achieve this goal, we want cooperation from kernel side, and build-time branching (i.e. kernel config options) will be the simplest and the most reliable.
Therefore, this patch introduces a kernel config option which allows selecting fine-grained kernel config options for twisting kernel's behavior. Each fine-grained kernel config option will be added by future patches. For ease of management, grouping kernel config options for allowing e.g. syzkaller to select all fine-grained kernel config options which e.g. syzkaller wants would be added by future patches.
[1] https://lkml.kernel.org/r/CACT4Y+a6KExbggs4mg8pvoD554PcDqQNW4sM15X-tc=YONCzYw@mail.gmail.com
---
lib/Kconfig.debug | 2 ++ lib/Kconfig.twist | 13 +++++++++++++ 2 files changed, 15 insertions(+)
lib/Kconfig.debug renamed from lib/Kconfig.debug~add-kernel-config-option-for-twisting-kernel-behavior +2 -0
@@ -2287,4 +2287,6 @@ config HYPERV_TESTING endmenu # "Kernel Testing and Coverage" +source "lib/Kconfig.twist" + endmenu # Kernel hacking
lib/Kconfig.twist new file +13 -0
@@ -0,0 +1,13 @@ +menuconfig TWIST_KERNEL_BEHAVIOR + bool "Twist kernel behavior" + help + Saying Y here allows modifying kernel behavior via kernel + config options which will become visible by selecting this + config option. Since these kernel config options are intended + for helping e.g. fuzz testing, behavior twisted by this kernel + option might be unstable. Userspace applications should not + count on this option being selected. + +if TWIST_KERNEL_BEHAVIOR + +endif # TWIST_KERNEL_BEHAVIOR
_
Patches currently in -mm which might be from [email protected] are
info-task-hung-in-generic_file_write_iter.patch info-task-hung-in-generic_file_write-fix.patch twist-allow-disabling-k_spec-function-in-drivers-tty-vt-keyboardc.patch twist-add-option-for-selecting-twist-options-for-syzkallers-testing.patch
[alternative-merged] twist-allow-disabling-k_spec-function-in-drivers-tty-vt-keyboardc.patch removed from -mm tree
In reply to Andrew MortonThe patch titled Subject: twist: allow disabling k_spec() function in drivers/tty/vt/keyboard.c has been removed from the -mm tree. Its filename was…
The patch titled
Subject: twist: allow disabling k_spec() function in drivers/tty/vt/keyboard.c
has been removed from the -mm tree. Its filename was
twist-allow-disabling-k_spec-function-in-drivers-tty-vt-keyboardc.patch
This patch was dropped because an alternative patch was merged
------------------------------------------------------
From: Tetsuo Handa <[email protected]>
Subject: twist: allow disabling k_spec() function in drivers/tty/vt/keyboard.c
syzbot is reporting unexpected kernel reboots [1]. This seems to be caused by triggering Ctrl-Alt-Del event via k_spec() function in drivers/tty/vt/keyboard.c file, for the console output includes normal restart sequence.
[ 97.727327][ T1] systemd-shutdown[1]: Unmounting file systems. [ 97.734278][ T1] systemd-shutdown[1]: Remounting '/' read-only with options ''. [ 97.747758][ T21] usb 2-1: device descriptor read/8, error -71 [ 97.747850][ T3116] usb 1-1: device descriptor read/8, error -71 [ 97.764818][ T1] EXT4-fs (sda1): re-mounted. Opts: [ 97.777551][ T1] systemd-shutdown[1]: Remounting '/' read-only with options ''. [ 97.785448][ T1] EXT4-fs (sda1): re-mounted. Opts: [ 97.790920][ T1] systemd-shutdown[1]: All filesystems unmounted. [ 97.797352][ T1] systemd-shutdown[1]: Deactivating swaps. [ 97.803451][ T1] systemd-shutdown[1]: All swaps deactivated. [ 97.809626][ T1] systemd-shutdown[1]: Detaching loop devices. [ 97.890294][ T1] systemd-shutdown[1]: All loop devices detached. [ 98.967832][ T3116] usb 1-1: device descriptor read/8, error -71 [ 100.108406][ T1] sd 0:0:1:0: [sda] Synchronizing SCSI cache [ 100.116036][ T1] reboot: Restarting system [ 100.120636][ T1] reboot: machine restart SeaBIOS (version 1.8.2-20200402_173431-google) Total RAM Size = 0x00000001e0000000 = 7680 MiB CPUs found: 2 Max CPUs supported: 2 Comparing RSDP and RSDP
Therefore, allow disabling only k_spec() function in order to allow fuzzers to examine the remaining part in that file.
[1] https://syzkaller.appspot.com/bug?id=321861b1588b44d064b779b92293c5d55cfe8430
---
drivers/tty/vt/keyboard.c | 2 ++ lib/Kconfig.twist | 7 +++++++ 2 files changed, 9 insertions(+)
drivers/tty/vt/keyboard.c renamed from drivers/tty/vt/keyboard.c~twist-allow-disabling-k_spec-function-in-drivers-tty-vt-keyboardc +2 -0
@@ -633,6 +633,8 @@ static void k_spec(struct vc_data *vc, u kbd->kbdmode == VC_OFF) && value != KVAL(K_SAK)) return; /* SAK is allowed even in raw mode */ +if (IS_ENABLED (CONFIG_TWIST_DISABLE_KBD_K_SPEC_HANDLER )) +return ; fn_handler[value](vc); }
lib/Kconfig.twist renamed from lib/Kconfig.twist~twist-allow-disabling-k_spec-function-in-drivers-tty-vt-keyboardc +7 -0
@@ -10,4 +10,11 @@ menuconfig TWIST_KERNEL_BEHAVIOR if TWIST_KERNEL_BEHAVIOR +config TWIST_DISABLE_KBD_K_SPEC_HANDLER + bool "Disable k_spec() function in drivers/tty/vt/keyboard.c" + help + k_spec() function allows triggering e.g. Ctrl-Alt-Del event. + Such event is annoying for fuzz testing which wants to test + kernel code without rebooting the system. + endif # TWIST_KERNEL_BEHAVIOR
_
Patches currently in -mm which might be from [email protected] are
info-task-hung-in-generic_file_write_iter.patch info-task-hung-in-generic_file_write-fix.patch twist-add-option-for-selecting-twist-options-for-syzkallers-testing.patch
[alternative-merged] twist-add-option-for-selecting-twist-options-for-syzkallers-testing.patch removed from -mm tree
In reply to Andrew MortonThe patch titled Subject: twist: add option for selecting twist options for syzkaller's testing has been removed from the -mm tree. Its filename was…
The patch titled
Subject: twist: add option for selecting twist options for syzkaller's testing
has been removed from the -mm tree. Its filename was
twist-add-option-for-selecting-twist-options-for-syzkallers-testing.patch
This patch was dropped because an alternative patch was merged
------------------------------------------------------
From: Tetsuo Handa <[email protected]>
Subject: twist: add option for selecting twist options for syzkaller's testing
When a kernel developer adds a kernel config option, they will not go and update configs on all external testing systems. This problem is also common for "enable all boot tests that can run on this kernel", or "configure a 'standard' debug build". Currently doing these things require all of expertise, sacred knowledge, checking all configs one-by-one as well as checking every new kernel patch and that needs to be done by everybody doing any kernel testing.
In order to reduce the burden of maintaining kernel config options, this patch introduces a kernel config option which will select twist options when building kernels for syzkaller's testing.
---
lib/Kconfig.twist | 6 ++++++ 1 file changed, 6 insertions(+)
lib/Kconfig.twist renamed from lib/Kconfig.twist~twist-add-option-for-selecting-twist-options-for-syzkallers-testing +6 -0
@@ -10,6 +10,12 @@ menuconfig TWIST_KERNEL_BEHAVIOR if TWIST_KERNEL_BEHAVIOR +config TWIST_FOR_SYZKALLER_TESTING + bool "Select all twist options suitable for syzkaller testing" + select TWIST_DISABLE_KBD_K_SPEC_HANDLER + help + Say N unless you are building kernels for syzkaller's testing. + config TWIST_DISABLE_KBD_K_SPEC_HANDLER bool "Disable k_spec() function in drivers/tty/vt/keyboard.c" help
_
Patches currently in -mm which might be from [email protected] are
info-task-hung-in-generic_file_write_iter.patch
info-task-hung-in-generic_file_write-fix.patch
Hmm..
Quoted 7 lines · Andrew Morton
fs/binfmt_elf.c | 2 +- include/asm-generic/topology.h | 2 +- include/linux/mm.h | 19 +++++++++++++++---- mm/khugepaged.c | 1 + mm/z3fold.c | 3 +++ 5 files changed, 21 insertions(+), 6 deletions(-)
I wonder how you generate that diffstat.
The change to <linux/mm.h> simply doesn't match what you sent me. The patch you sent me that changed mm.h had this:
include/linux/mm.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
(note 15 lines changed: it's +13 and -2) but now suddenly in your overall diffstat you have that
include/linux/mm.h | 19 +++++++++++++++----
with +15/-4.
So your diffstat simply doesn't match what you are sending. What's going on?
Linus
Andrew Morton
maintainerQuoted 20 lines · On Thu, 28 May 2020 13:10:18 -0700 Linus Torvalds…
Hmm..
Quoted 7 lines · Andrew Morton
fs/binfmt_elf.c | 2 +- include/asm-generic/topology.h | 2 +- include/linux/mm.h | 19 +++++++++++++++---- mm/khugepaged.c | 1 + mm/z3fold.c | 3 +++ 5 files changed, 21 insertions(+), 6 deletions(-)I wonder how you generate that diffstat.
The change to <
linux/mm.h> simply doesn't match what you sent me. The patch you sent me that changedmm.hhad this:include/linux/mm.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
Quoted 9 lines
(note 15 lines changed: it's +13 and -2) but now suddenly in your overall diffstat you have that
include/linux/mm.h | 19 +++++++++++++++----with +15/-4.
So your diffstat simply doesn't match what you are sending. What's going on?
Bah. I got lazy (didn't want to interrupt an ongoing build) so I generated the diffstat prior to folding two patches into a single one. Evidently diffstat isn't as smart as I had assumed!
Quoted 4 lines · Andrew Morton
Bah. I got lazy (didn't want to interrupt an ongoing build) so I generated the diffstat prior to folding two patches into a single one. Evidently diffstat isn't as smart as I had assumed!
Ahh. Yes - given two patches, diffstat just adds up the line number counts for the individual diffs, it doesn't count some kind of "combined diff result" line counts.
Linus
Andrew Morton
maintainerQuoted 9 lines · On Fri, 29 May 2020 13:38:35 -0700 Linus Torvalds…
Quoted 4 lines · Andrew Morton
Bah. I got lazy (didn't want to interrupt an ongoing build) so I generated the diffstat prior to folding two patches into a single one. Evidently diffstat isn't as smart as I had assumed!
Ahh. Yes - given two patches, diffstat just adds up the line number counts for the individual diffs, it doesn't count some kind of "combined diff result" line counts.
Stupid diffstat. Means that basically all my diffstats are very wrong. Thanks for spotting it.
I can fix that...
Quoted 2 lines · Andrew Morton
Stupid diffstat. Means that basically all my diffstats are very wrong.
I'm actually used to diffstats not matching 100%/
Usually it's not due to this issue - a "git diff --stat" *will* give the stat from the actual combined diff result - but with git diffstats the issue is that I might have gotten a patch from another source.
So the diffstat I see after-the-merge is possibly different from the pre-merge diffstat simply due to merge issues.
So then I usually take a look at "ok, why did that diffstat differ" and go "Ahh".
In your case, when I looked at the diffstat, I couldn't for the life of me see how you would have gotten the diffstat you did, since I only saw a single patch with no merge issues.
Quoted 3 lines
Thanks for spotting it.
I can fix that...
I can also just live with it, knowing what your workflow is. The diffstat matching exactly just isn't that important - in fact, different versions of "diff" can give slightly different output anyway depending on diff algorithms even when they are looking at the exact same before/after state. There's not necessarily always only one way to generate a valid diff.
So to me, the diffstat is more of a guide than a hard thing, and I want to see the rough outline,
In fact, one reason I want to see it in pull requests is actually just that I want to get a feel for what changes even before I do the pull or merge, so it's not just a "match against what I get" thing.
Linus