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-next>] [day] [month] [year] [list]
Message-ID: <2C69C7D31680437FB174C65D043E2455@fujitsulixd>
Date:	Wed, 29 Oct 2008 14:31:18 +0800
From:	"Li Xiaodong" <lixd@...fujitsu.com>
To:	<linux-kernel@...r.kernel.org>
Subject: [PATCH]swap-zero-page-bug

According to Documentation/filesystems/proc.txt, kernel should swap one page
as vm.page-cluster is 0, while it seems not like so in mm/swapfile.c:
     ...
	int our_page_cluster = page_cluster;
	...
	if (!our_page_cluster)  /* no readahead */
                return 0;
	...

It is better to remove that checkpoint.

Signed-off-by: Li Xiaodong<lixd@...fujitsu.com>
--- swapfile.c.orig	2008-10-29 21:29:36.000000000 +0800
+++ swapfile.c	2008-10-29 21:59:49.000000000 +0800
@@ -1810,9 +1810,6 @@
 	pgoff_t base, end;
 	int nr_pages = 0;
 
-	if (!our_page_cluster)	/* no readahead */
-		return 0;
-
 	si = &swap_info[swp_type(entry)];
 	target = swp_offset(entry);
 	base = (target >> our_page_cluster) << our_page_cluster; @@ -1847,5
+1844,5 @@
 	 * if only 1, say 0, since there's then no readahead to be done.
 	 */
 	*offset = ++toff;
-	return nr_pages? ++nr_pages: 0;
+	return nr_pages ? ++nr_pages : nr_pages;
 }


Download attachment "[PATCH]swap-zero-page-bug.patch" of type "application/octet-stream" (600 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ