+ mm-fix-use-after-free-of-page_ext-after-race-with-memory-offline-v5.patch added to mm-unstable branch

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

 



The patch titled
     Subject: mm-fix-use-after-free-of-page_ext-after-race-with-memory-offline-v5
has been added to the -mm mm-unstable branch.  Its filename is
     mm-fix-use-after-free-of-page_ext-after-race-with-memory-offline-v5.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-fix-use-after-free-of-page_ext-after-race-with-memory-offline-v5.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: Charan Teja Kalla <quic_charante@xxxxxxxxxxx>
Subject: mm-fix-use-after-free-of-page_ext-after-race-with-memory-offline-v5
Date: Fri, 26 Aug 2022 12:26:33 +0530

rename label `loop' to `ext_put_continue' per David

Link: https://lkml.kernel.org/r/1661496993-11473-1-git-send-email-quic_charante@xxxxxxxxxxx
Signed-off-by: Charan Teja Kalla <quic_charante@xxxxxxxxxxx>
Suggested-by: David Hildenbrand <david@xxxxxxxxxx>
Suggested-by: Michal Hocko <mhocko@xxxxxxxx>
Cc: Fernand Sieber <sieberf@xxxxxxxxxx>
Cc: Minchan Kim <minchan@xxxxxxxxxx>
Cc: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>
Cc: Pavan Kondeti <quic_pkondeti@xxxxxxxxxxx>
Cc: SeongJae Park <sjpark@xxxxxxxxx>
Cc: Shakeel Butt <shakeelb@xxxxxxxxxx>
Cc: Vlastimil Babka <vbabka@xxxxxxx>
Cc: William Kucharski <william.kucharski@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/page_owner.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

--- a/mm/page_owner.c~mm-fix-use-after-free-of-page_ext-after-race-with-memory-offline-v5
+++ a/mm/page_owner.c
@@ -326,7 +326,7 @@ void pagetypeinfo_showmixedcount_print(s
 				continue;
 
 			if (!test_bit(PAGE_EXT_OWNER_ALLOCATED, &page_ext->flags))
-				goto loop;
+				goto ext_put_continue;
 
 			page_owner = get_page_owner(page_ext);
 			page_mt = gfp_migratetype(page_owner->gfp_mask);
@@ -341,7 +341,7 @@ void pagetypeinfo_showmixedcount_print(s
 				break;
 			}
 			pfn += (1UL << page_owner->order) - 1;
-loop:
+ext_put_continue:
 			page_ext_put(page_ext);
 		}
 	}
@@ -561,14 +561,14 @@ read_page_owner(struct file *file, char
 		 * because we don't hold the zone lock.
 		 */
 		if (!test_bit(PAGE_EXT_OWNER, &page_ext->flags))
-			goto loop;
+			goto ext_put_continue;
 
 		/*
 		 * Although we do have the info about past allocation of free
 		 * pages, it's not relevant for current memory usage.
 		 */
 		if (!test_bit(PAGE_EXT_OWNER_ALLOCATED, &page_ext->flags))
-			goto loop;
+			goto ext_put_continue;
 
 		page_owner = get_page_owner(page_ext);
 
@@ -577,7 +577,7 @@ read_page_owner(struct file *file, char
 		 * would inflate the stats.
 		 */
 		if (!IS_ALIGNED(pfn, 1 << page_owner->order))
-			goto loop;
+			goto ext_put_continue;
 
 		/*
 		 * Access to page_ext->handle isn't synchronous so we should
@@ -585,7 +585,7 @@ read_page_owner(struct file *file, char
 		 */
 		handle = READ_ONCE(page_owner->handle);
 		if (!handle)
-			goto loop;
+			goto ext_put_continue;
 
 		/* Record the next PFN to read in the file offset */
 		*ppos = (pfn - min_low_pfn) + 1;
@@ -594,7 +594,7 @@ read_page_owner(struct file *file, char
 		page_ext_put(page_ext);
 		return print_page_owner(buf, count, pfn, page,
 				&page_owner_tmp, handle);
-loop:
+ext_put_continue:
 		page_ext_put(page_ext);
 	}
 
@@ -654,13 +654,13 @@ static void init_pages_in_zone(pg_data_t
 
 			/* Maybe overlapping zone */
 			if (test_bit(PAGE_EXT_OWNER, &page_ext->flags))
-				goto loop;
+				goto ext_put_continue;
 
 			/* Found early allocated page */
 			__set_page_owner_handle(page_ext, early_handle,
 						0, 0);
 			count++;
-loop:
+ext_put_continue:
 			page_ext_put(page_ext);
 		}
 		cond_resched();
_

Patches currently in -mm which might be from quic_charante@xxxxxxxxxxx are

mm-page_ext-remove-unused-variable-in-offline_page_ext.patch
mm-cma_debug-show-complete-cma-name-in-debugfs-directories.patch
mm-oom_kill-add-trace-logs-in-process_mrelease-system-call.patch
mm-fix-use-after-free-of-page_ext-after-race-with-memory-offline.patch
mm-fix-use-after-free-of-page_ext-after-race-with-memory-offline-v5.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