[linux] 01/01: mm/huge_memory.c: fix up "mm/huge_memory.c: respect FOLL_FORCE/FOLL_COW for thp" backport

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Sun Apr 30 04:09:23 UTC 2017


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch jessie
in repository linux.

commit ae3e344deaa58b50640a1117ac05752e06fbe981
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Sun Apr 30 03:39:52 2017 +0100

    mm/huge_memory.c: fix up "mm/huge_memory.c: respect FOLL_FORCE/FOLL_COW for thp" backport
    
    Closes: #861313
    
    This was already fixed in 3.2 and 3.12 stable updates, but I failed to
    realise that it was also needed for 3.16.
---
 debian/changelog                                   |  7 +++
 ...ory.c-fix-up-mm-huge_memory.c-respect-fol.patch | 59 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 67 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 92ef2de..c9a1735 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+linux (3.16.43-2) jessie; urgency=high
+
+  * mm/huge_memory.c: fix up "mm/huge_memory.c: respect FOLL_FORCE/FOLL_COW for
+    thp" backport (Closes: #861313)
+
+ -- Ben Hutchings <ben at decadent.org.uk>  Sun, 30 Apr 2017 03:37:58 +0100
+
 linux (3.16.43-1) jessie; urgency=medium
 
   * New upstream stable update:
diff --git a/debian/patches/bugfix/all/mm-huge_memory.c-fix-up-mm-huge_memory.c-respect-fol.patch b/debian/patches/bugfix/all/mm-huge_memory.c-fix-up-mm-huge_memory.c-respect-fol.patch
new file mode 100644
index 0000000..23759ed
--- /dev/null
+++ b/debian/patches/bugfix/all/mm-huge_memory.c-fix-up-mm-huge_memory.c-respect-fol.patch
@@ -0,0 +1,59 @@
+From: Michal Hocko <mhocko at suse.com>
+Date: Tue, 28 Mar 2017 15:17:26 +0200
+Subject: mm/huge_memory.c: fix up "mm/huge_memory.c: respect FOLL_FORCE/FOLL_COW for thp" backport
+Origin: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit?id=2ea6895123eb8604c1c0c153e2fcd1305fb96aca
+Bug-Debian: https://bugs.debian.org/861313
+
+This is a stable follow up fix for an incorrect backport. The issue is
+not present in the upstream kernel.
+
+Miroslav has noticed the following splat when testing my 3.2 forward
+port of 8310d48b125d ("mm/huge_memory.c: respect FOLL_FORCE/FOLL_COW for
+thp") to 3.12:
+
+BUG: Bad page state in process a.out  pfn:26400
+page:ffffea000085e000 count:0 mapcount:1 mapping:          (null) index:0x7f049d600
+page flags: 0x1fffff80108018(uptodate|dirty|head|swapbacked)
+page dumped because: nonzero mapcount
+[iii]
+CPU: 2 PID: 5926 Comm: a.out Tainted: G            E    3.12.61-0-default #1
+Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014
+ 0000000000000000 ffffffff81515830 ffffea000085e000 ffffffff81800ad7
+ ffffffff815118a5 ffffea000085e000 0000000000000000 000fffff80000000
+ ffffffff81140f18 fff000007c000000 ffffea000085e000 0000000000000009
+Call Trace:
+ [<ffffffff8100475d>] dump_trace+0x7d/0x2d0
+ [<ffffffff81004a44>] show_stack_log_lvl+0x94/0x170
+ [<ffffffff81005ce1>] show_stack+0x21/0x50
+ [<ffffffff81515830>] dump_stack+0x5d/0x78
+ [<ffffffff815118a5>] bad_page.part.67+0xe8/0x102
+ [<ffffffff81140f18>] free_pages_prepare+0x198/0x1b0
+ [<ffffffff81141275>] __free_pages_ok+0x15/0xd0
+ [<ffffffff8116444c>] __access_remote_vm+0x7c/0x1e0
+ [<ffffffff81205afb>] mem_rw.isra.13+0x14b/0x1a0
+ [<ffffffff811a3b18>] vfs_write+0xb8/0x1e0
+ [<ffffffff811a469b>] SyS_pwrite64+0x6b/0xa0
+ [<ffffffff81523b49>] system_call_fastpath+0x16/0x1b
+ [<00007f049da18573>] 0x7f049da18572
+
+The problem is that the original 3.2 backport didn't return NULL page on
+the FOLL_COW page and so the page got reused.
+
+Reported-and-tested-by: Miroslav Beneš <mbenes at suse.com>
+Signed-off-by: Michal Hocko <mhocko at suse.com>
+Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
+---
+ mm/huge_memory.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/mm/huge_memory.c
++++ b/mm/huge_memory.c
+@@ -1226,7 +1226,7 @@ struct page *follow_trans_huge_pmd(struc
+ 	VM_BUG_ON_PAGE(!PageHead(page), page);
+ 
+ 	if (flags & FOLL_WRITE && !can_follow_write_pmd(*pmd, page, flags))
+-		goto out;
++		return NULL;
+ 
+ 	if (flags & FOLL_TOUCH) {
+ 		pmd_t _pmd;
diff --git a/debian/patches/series b/debian/patches/series
index ab82e56..5060999 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -693,6 +693,7 @@ bugfix/all/keys-special-dot-prefixed-keyring-name-bug-fix.patch
 bugfix/all/keys-reinstate-eperm-for-a-key-type-name-beginning-w.patch
 bugfix/all/keys-disallow-keyrings-beginning-with-.-to-be-joined.patch
 bugfix/all/keys-fix-keyctl_set_reqkey_keyring-to-not-leak-threa.patch
+bugfix/all/mm-huge_memory.c-fix-up-mm-huge_memory.c-respect-fol.patch
 
 # Fix ABI changes
 debian/of-fix-abi-changes.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list