* + mm-madvise-introduce-madv_collapse-sync-hugepage-collapse-fix.patch added to mm-unstable branch
@ 2022-07-13 15:32 Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2022-07-13 15:32 UTC (permalink / raw)
To: mm-commits, zokeefe, lkp, dan.carpenter, jrdr.linux, akpm
The patch titled
Subject: mm/khugepaged: Avoid possible memory leak in failure path
has been added to the -mm mm-unstable branch. Its filename is
mm-madvise-introduce-madv_collapse-sync-hugepage-collapse-fix.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-madvise-introduce-madv_collapse-sync-hugepage-collapse-fix.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Souptick Joarder <jrdr.linux@gmail.com>
Subject: mm/khugepaged: Avoid possible memory leak in failure path
Date: Wed, 13 Jul 2022 08:11:09 +0530
smatch warnings:
mm/khugepaged.c:2409 madvise_collapse() warn: possible memory
leak of 'cc'
Avoiding possible memory leak.
Link: https://lkml.kernel.org/r/20220713024109.62810-1-jrdr.linux@gmail.com
Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Zach O'Keefe <zokeefe@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/khugepaged.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/mm/khugepaged.c~mm-madvise-introduce-madv_collapse-sync-hugepage-collapse-fix
+++ a/mm/khugepaged.c
@@ -2396,12 +2396,6 @@ int madvise_collapse(struct vm_area_stru
BUG_ON(vma->vm_start > start);
BUG_ON(vma->vm_end < end);
- cc = kmalloc(sizeof(*cc), GFP_KERNEL);
- if (!cc)
- return -ENOMEM;
- cc->is_khugepaged = false;
- cc->last_target_node = NUMA_NO_NODE;
-
*prev = vma;
/* TODO: Support file/shmem */
@@ -2414,6 +2408,12 @@ int madvise_collapse(struct vm_area_stru
if (!hugepage_vma_check(vma, vma->vm_flags, false, false, false))
return -EINVAL;
+ cc = kmalloc(sizeof(*cc), GFP_KERNEL);
+ if (!cc)
+ return -ENOMEM;
+ cc->is_khugepaged = false;
+ cc->last_target_node = NUMA_NO_NODE;
+
mmgrab(mm);
lru_add_drain_all();
_
Patches currently in -mm which might be from jrdr.linux@gmail.com are
mm-madvise-introduce-madv_collapse-sync-hugepage-collapse-fix.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
* + mm-madvise-introduce-madv_collapse-sync-hugepage-collapse-fix.patch added to mm-unstable branch
@ 2022-09-13 23:57 Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2022-09-13 23:57 UTC (permalink / raw)
To: mm-commits, zokeefe, shy828301, akpm
The patch titled
subject: mm-madvise-introduce-madv_collapse-sync-hugepage-collapse-fix
has been added to the -mm mm-unstable branch. Its filename is
mm-madvise-introduce-madv_collapse-sync-hugepage-collapse-fix.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-madvise-introduce-madv_collapse-sync-hugepage-collapse-fix.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Yang Shi <shy828301@gmail.com>
subject: mm-madvise-introduce-madv_collapse-sync-hugepage-collapse-fix
Date: Tue, 13 Sep 2022 09:14:15 -0700
Link: https://lkml.kernel.org/r/CAHbLzkrr3PvKjs2vanVi5JFTQQ3R7hSNRWoHhAw+gBWOcFurcw@mail.gmail.com
Fixes: 7d8faaf155454 ("mm/madvise: introduce MADV_COLLAPSE sync hugepage collapse")
Signed-off-by:: Yang Shi <shy828301@gmail.com>
Reported-by: syzbot+915f3e317adb0e85835f@syzkaller.appspotmail.com
Cc: "Zach O'Keefe" <zokeefe@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/khugepaged.c | 2 ++
1 file changed, 2 insertions(+)
--- a/mm/khugepaged.c~mm-madvise-introduce-madv_collapse-sync-hugepage-collapse-fix
+++ a/mm/khugepaged.c
@@ -2438,6 +2438,8 @@ int madvise_collapse(struct vm_area_stru
last_fail = result;
goto out_nolock;
}
+
+ hend = vma->vm_end & HPAGE_PMD_MASK;
}
mmap_assert_locked(mm);
memset(cc->node_load, 0, sizeof(cc->node_load));
_
Patches currently in -mm which might be from shy828301@gmail.com are
mm-gup-fix-the-fast-gup-race-against-thp-collapse.patch
powerpc-64s-radix-dont-need-to-broadcast-ipi-for-radix-pmd-collapse-flush.patch
mm-madvise-introduce-madv_collapse-sync-hugepage-collapse-fix.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-13 23:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-13 23:57 + mm-madvise-introduce-madv_collapse-sync-hugepage-collapse-fix.patch added to mm-unstable branch Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2022-07-13 15:32 Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.