+ mm-page_owner-clamp-read-count-to-page_size.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm/page_owner: clamp read count to PAGE_SIZE
has been added to the -mm tree.  Its filename is
     mm-page_owner-clamp-read-count-to-page_size.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-page_owner-clamp-read-count-to-page_size.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-page_owner-clamp-read-count-to-page_size.patch

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 and is updated
there every 3-4 working days

------------------------------------------------------
From: Miles Chen <miles.chen@xxxxxxxxxxxx>
Subject: mm/page_owner: clamp read count to PAGE_SIZE

The (root-only) page owner read might allocate a large size of memory with
a large read count.  Allocation fails can easily occur when doing high
order allocations.

Clamp buffer size to PAGE_SIZE to avoid arbitrary size allocation
and avoid allocation fails due to high order allocation.

Link: http://lkml.kernel.org/r/1541091607-27402-1-git-send-email-miles.chen@xxxxxxxxxxxx
Signed-off-by: Miles Chen <miles.chen@xxxxxxxxxxxx>
Acked-by: Michal Hocko <mhocko@xxxxxxxx>
Cc: Joe Perches <joe@xxxxxxxxxxx>
Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/page_owner.c |    1 +
 1 file changed, 1 insertion(+)

--- a/mm/page_owner.c~mm-page_owner-clamp-read-count-to-page_size
+++ a/mm/page_owner.c
@@ -351,6 +351,7 @@ print_page_owner(char __user *buf, size_
 		.skip = 0
 	};
 
+	count = count > PAGE_SIZE ? PAGE_SIZE : count;
 	kbuf = kmalloc(count, GFP_KERNEL);
 	if (!kbuf)
 		return -ENOMEM;
_

Patches currently in -mm which might be from miles.chen@xxxxxxxxxxxx are

mm-page_owner-clamp-read-count-to-page_size.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux