+ tools-vm-page_owner_sortc-fix-the-potential-stack-overflow-risk.patch added to -mm tree

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

 



The patch titled
     Subject: tools/vm/page_owner_sort.c: check malloc return
has been added to the -mm tree.  Its filename is
     tools-vm-page_owner_sortc-fix-the-potential-stack-overflow-risk.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/tools-vm-page_owner_sortc-fix-the-potential-stack-overflow-risk.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/tools-vm-page_owner_sortc-fix-the-potential-stack-overflow-risk.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: Tang Bin <tangbin@xxxxxxxxxxxxxxxxxxxx>
Subject: tools/vm/page_owner_sort.c: check malloc return

Link: https://lkml.kernel.org/r/20210506131402.10416-1-tangbin@xxxxxxxxxxxxxxxxxxxx
Signed-off-by: Zhang Shengju <zhangshengju@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Tang Bin <tangbin@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 tools/vm/page_owner_sort.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/tools/vm/page_owner_sort.c~tools-vm-page_owner_sortc-fix-the-potential-stack-overflow-risk
+++ a/tools/vm/page_owner_sort.c
@@ -132,6 +132,10 @@ int main(int argc, char **argv)
 	qsort(list, list_size, sizeof(list[0]), compare_txt);
 
 	list2 = malloc(sizeof(*list) * list_size);
+	if (!list2) {
+		printf("Out of memory\n");
+		exit(1);
+	}
 
 	printf("culling\n");
 
_

Patches currently in -mm which might be from tangbin@xxxxxxxxxxxxxxxxxxxx are

tools-vm-page_owner_sortc-fix-the-potential-stack-overflow-risk.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