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:	Tue, 10 Feb 2009 17:51:35 +0100
From:	Johannes Weiner <hannes@...xchg.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: [patch] vmscan: initialize sc.order in indirect shrink_list() users

shrink_all_memory() and __zone_reclaim() currently don't initialize
the .order field of their scan control.

Both of them call into functions which use that field and make certain
decisions based on a random value.

The functions depending on the .order field are marked with a star,
the faulty entry points are marked with a percentage sign:

* shrink_page_list()
  * shrink_inactive_list()
  * shrink_active_list()
    shrink_list()
      shrink_all_zones()
        % shrink_all_memory()
      shrink_zone()
        % __zone_reclaim()

Initialize .order to zero in shrink_all_memory().  Initialize .order
to the order parameter in __zone_reclaim().

Signed-off-by: Johannes Weiner <hannes@...xchg.org>
---
 mm/vmscan.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 4422301..9ce85ea 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2112,6 +2112,7 @@ unsigned long shrink_all_memory(unsigned long nr_pages)
 		.may_unmap = 0,
 		.swap_cluster_max = nr_pages,
 		.may_writepage = 1,
+		.order = 0,
 		.isolate_pages = isolate_pages_global,
 	};
 
@@ -2294,6 +2295,7 @@ static int __zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
 					SWAP_CLUSTER_MAX),
 		.gfp_mask = gfp_mask,
 		.swappiness = vm_swappiness,
+		.order = order,
 		.isolate_pages = isolate_pages_global,
 	};
 	unsigned long slab_reclaimable;
-- 
1.6.0.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ