[folded-merged] mm-mremap-downgrade-mmap_sem-to-read-when-shrinking-fix-2.patch removed from -mm tree

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

 



The patch titled
     Subject: mm/mremap.c: mremap: fix unsigned compare against 0 issue
has been removed from the -mm tree.  Its filename was
     mm-mremap-downgrade-mmap_sem-to-read-when-shrinking-fix-2.patch

This patch was dropped because it was folded into mm-mremap-downgrade-mmap_sem-to-read-when-shrinking.patch

------------------------------------------------------
From: Yang Shi <yang.shi@xxxxxxxxxxxxxxxxx>
Subject: mm/mremap.c: mremap: fix unsigned compare against 0 issue

Static analysis reported an unsigned compare against 0 issue

Define an int temp variable to check the return value of __do_munmap().

Link: http://lkml.kernel.org/r/1538687672-17795-2-git-send-email-yang.shi@xxxxxxxxxxxxxxxxx
Reported-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
Signed-off-by: Yang Shi <yang.shi@xxxxxxxxxxxxxxxxx>
Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Vlastimil Babka <vbabka@xxxxxxx>
Cc: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
Cc: Michal Hocko <mhocko@xxxxxxxxxx>
Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx>
Cc: Laurent Dufour <ldufour@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---


--- a/mm/mremap.c~mm-mremap-downgrade-mmap_sem-to-read-when-shrinking-fix-2
+++ a/mm/mremap.c
@@ -562,12 +562,15 @@ SYSCALL_DEFINE5(mremap, unsigned long, a
 	 * downgrades mmap_sem to read if so directed.
 	 */
 	if (old_len >= new_len) {
-		ret = __do_munmap(mm, addr+new_len, old_len - new_len,
+		int retval;
+
+		retval = __do_munmap(mm, addr+new_len, old_len - new_len,
 				  &uf_unmap, true);
-		if (ret < 0 && old_len != new_len)
+		if (retval < 0 && old_len != new_len) {
+			ret = retval;
 			goto out;
 		/* Returning 1 indicates mmap_sem is downgraded to read. */
-		else if (ret == 1)
+		} else if (retval == 1)
 			downgraded = true;
 		ret = addr;
 		goto out;
_

Patches currently in -mm which might be from yang.shi@xxxxxxxxxxxxxxxxx are

mm-mmap-zap-pages-with-read-mmap_sem-in-munmap.patch
mm-unmap-vm_hugetlb-mappings-with-optimized-path.patch
mm-unmap-vm_pfnmap-mappings-with-optimized-path.patch
mm-mremap-downgrade-mmap_sem-to-read-when-shrinking.patch
mm-brk-downgrade-mmap_sem-to-read-when-shrinking.patch
mm-brk-downgrade-mmap_sem-to-read-when-shrinking-fix-2.patch
mm-dax-add-comment-for-pfn_special.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