From: Greg Kroah-Hartman Date: Thu, 25 Feb 2016 19:57:28 +0000 (-0800) Subject: delete queue-3.14/mm-fix-mlock-accouting.patch X-Git-Tag: v3.10.98~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cfcc1f92aa48ae22e02dbeab5c4a34289f50d3c2;p=thirdparty%2Fkernel%2Fstable-queue.git delete queue-3.14/mm-fix-mlock-accouting.patch --- diff --git a/queue-3.14/mm-fix-mlock-accouting.patch b/queue-3.14/mm-fix-mlock-accouting.patch deleted file mode 100644 index b9e0ceea082..00000000000 --- a/queue-3.14/mm-fix-mlock-accouting.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 7162a1e87b3e380133dadc7909081bb70d0a7041 Mon Sep 17 00:00:00 2001 -From: "Kirill A. Shutemov" -Date: Thu, 21 Jan 2016 16:40:27 -0800 -Subject: mm: fix mlock accouting - -From: Kirill A. Shutemov - -commit 7162a1e87b3e380133dadc7909081bb70d0a7041 upstream. - -Tetsuo Handa reported underflow of NR_MLOCK on munlock. - -Testcase: - - #include - #include - #include - - #define BASE ((void *)0x400000000000) - #define SIZE (1UL << 21) - - int main(int argc, char *argv[]) - { - void *addr; - - system("grep Mlocked /proc/meminfo"); - addr = mmap(BASE, SIZE, PROT_READ | PROT_WRITE, - MAP_ANONYMOUS | MAP_PRIVATE | MAP_LOCKED | MAP_FIXED, - -1, 0); - if (addr == MAP_FAILED) - printf("mmap() failed\n"), exit(1); - munmap(addr, SIZE); - system("grep Mlocked /proc/meminfo"); - return 0; - } - -It happens on munlock_vma_page() due to unfortunate choice of nr_pages -data type: - - __mod_zone_page_state(zone, NR_MLOCK, -nr_pages); - -For unsigned int nr_pages, implicitly casted to long in -__mod_zone_page_state(), it becomes something around UINT_MAX. - -munlock_vma_page() usually called for THP as small pages go though -pagevec. - -Let's make nr_pages signed int. - -Similar fixes in 6cdb18ad98a4 ("mm/vmstat: fix overflow in -mod_zone_page_state()") used `long' type, but `int' here is OK for a -count of the number of sub-pages in a huge page. - -Fixes: ff6a6da60b89 ("mm: accelerate munlock() treatment of THP pages") -Signed-off-by: Kirill A. Shutemov -Reported-by: Tetsuo Handa -Tested-by: Tetsuo Handa -Cc: Michel Lespinasse -Acked-by: Michal Hocko -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Greg Kroah-Hartman - ---- - mm/mlock.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/mm/mlock.c -+++ b/mm/mlock.c -@@ -172,7 +172,7 @@ static void __munlock_isolation_failed(s - */ - unsigned int munlock_vma_page(struct page *page) - { -- unsigned int nr_pages; -+ int nr_pages; - struct zone *zone = page_zone(page); - - /* For try_to_munlock() and to serialize with page migration */ diff --git a/queue-3.14/series b/queue-3.14/series index f6ab67a980e..d98256c772e 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -49,7 +49,6 @@ arm-8517-1-icst-avoid-arithmetic-overflow-in-icst_hz.patch kvm-ppc-fix-emulation-of-h_set_dabr-x-on-power8.patch fuse-break-infinite-loop-in-fuse_fill_write_pages.patch mm-soft-offline-check-return-value-in-second-__get_any_page-call.patch -mm-fix-mlock-accouting.patch input-elantech-add-fujitsu-lifebook-u745-to-force-crc_enabled.patch input-elantech-mark-protocols-v2-and-v3-as-semi-mt.patch input-i8042-add-fujitsu-lifebook-u745-to-the-nomux-list.patch