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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 30 May 2018 20:23:16 -0700 (PDT)
From:   Hugh Dickins <hughd@...gle.com>
To:     Andrew Morton <akpm@...ux-foundation.org>
cc:     Mel Gorman <mgorman@...hsingularity.net>,
        Minchan Kim <minchan@...nel.org>,
        "Huang, Ying" <ying.huang@...el.com>, Jan Kara <jack@...e.cz>,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: [PATCH] mm: fix the NULL mapping case in __isolate_lru_page()

George Boole would have noticed a slight error in 4.16 commit 69d763fc6d3a
("mm: pin address_space before dereferencing it while isolating an LRU page").
Fix it, to match both the comment above it, and the original behaviour.

Although anonymous pages are not marked PageDirty at first, we have an
old habit of calling SetPageDirty when a page is removed from swap cache:
so there's a category of ex-swap pages that are easily migratable, but
were inadvertently excluded from compaction's async migration in 4.16.

Fixes: 69d763fc6d3a ("mm: pin address_space before dereferencing it while isolating an LRU page")
Signed-off-by: Hugh Dickins <hughd@...gle.com>
---

 mm/vmscan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 4.17-rc7/mm/vmscan.c	2018-04-26 10:48:36.027288294 -0700
+++ linux/mm/vmscan.c	2018-05-30 20:08:39.184634029 -0700
@@ -1418,7 +1418,7 @@ int __isolate_lru_page(struct page *page
 				return ret;
 
 			mapping = page_mapping(page);
-			migrate_dirty = mapping && mapping->a_ops->migratepage;
+			migrate_dirty = !mapping || mapping->a_ops->migratepage;
 			unlock_page(page);
 			if (!migrate_dirty)
 				return ret;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ