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>] [day] [month] [year] [list]
Date:	Mon, 27 Jan 2014 18:03:04 +0800
From:	Weijie Yang <weijie.yang@...sung.com>
To:	hughd@...gle.com
Cc:	'Andrew Morton' <akpm@...ux-foundation.org>,
	'Minchan Kim' <minchan@...nel.org>, shli@...nel.org,
	'Bob Liu' <bob.liu@...cle.com>, weijie.yang.kh@...il.com,
	'Heesub Shin' <heesub.shin@...sung.com>, mquzik@...hat.com,
	'Linux-MM' <linux-mm@...ck.org>,
	'linux-kernel' <linux-kernel@...r.kernel.org>,
	stable@...r.kernel.org, xfishcoder@...il.com
Subject: [PATCH 8/8] mm/frontswap: add missing handle on a dup-store failure

If a frontswap dup-store failed, it should invalidate the old page in
backend and return failure.

This patch add this missing handle. According to the comments of
__frontswap_store(), it should have been there.

Reported-by: changkun.li <xfishcoder@...il.com>
Signed-off-by: Weijie Yang <weijie.yang@...sung.com>
---
 mm/frontswap.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/frontswap.c b/mm/frontswap.c
index df067f1..171c6c0 100644
--- a/mm/frontswap.c
+++ b/mm/frontswap.c
@@ -245,8 +245,10 @@ int __frontswap_store(struct page *page)
 		  the (older) page from frontswap
 		 */
 		inc_frontswap_failed_stores();
-		if (dup)
+		if (dup) {
 			__frontswap_clear(sis, offset);
+			frontswap_ops->invalidate_page(type, offset);
+		}
 	}
 	if (frontswap_writethrough_enabled)
 		/* report failure so swap also writes to swap device */
-- 
1.7.10.4


--
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