lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241127082201.1276-2-gourry@gourry.net>
Date: Wed, 27 Nov 2024 03:21:58 -0500
From: Gregory Price <gourry@...rry.net>
To: linux-mm@...ck.org
Cc: linux-kernel@...r.kernel.org,
	nehagholkar@...a.com,
	abhishekd@...a.com,
	kernel-team@...a.com,
	david@...hat.com,
	ying.huang@...el.com,
	nphamcs@...il.com,
	gourry@...rry.net,
	akpm@...ux-foundation.org,
	hannes@...xchg.org,
	feng.tang@...el.com,
	kbusch@...a.com
Subject: [PATCH 1/4] migrate: Allow migrate_misplaced_folio APIs without a VMA

To migrate unmapped pagecache folios, migrate_misplaced_folio and
migrate_misplaced_folio_prepare must handle folios without VMAs.

migrate_misplaced_folio_prepare checks VMA for exec bits, so allow
a NULL VMA when it does not have a mapping.

migrate_misplaced_folio must call migrate_pages with MIGRATE_SYNC
when in the pagecache path because it is a synchronous context.

Suggested-by: Johannes Weiner <hannes@...xchg.org>
Signed-off-by: Gregory Price <gourry@...rry.net>
---
 mm/migrate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index dfb5eba3c522..3b0bd3f21ac3 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -2632,7 +2632,7 @@ int migrate_misplaced_folio_prepare(struct folio *folio,
 		 * See folio_likely_mapped_shared() on possible imprecision
 		 * when we cannot easily detect if a folio is shared.
 		 */
-		if ((vma->vm_flags & VM_EXEC) &&
+		if (vma && (vma->vm_flags & VM_EXEC) &&
 		    folio_likely_mapped_shared(folio))
 			return -EACCES;
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ