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: <50332B37.2000500@cn.fujitsu.com>
Date:	Tue, 21 Aug 2012 14:31:19 +0800
From:	Wen Congyang <wency@...fujitsu.com>
To:	Andrew Morton <akpm@...ux-foundation.org>, mgorman@...e.de,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	hughd@...gle.com, minchan@...nel.org, linux-mm@...ck.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] memory hotplug: reset pgdat->kswapd to NULL if creating kernel
 thread fails

If kthread_run() fails, pgdat->kswapd contains errno. When we stop
this thread, we only check whether pgdat->kswapd is NULL and access
it. If it contains errno, it will cause page fault. Reset pgdat->kswapd
to NULL when creating kernel thread fails can avoid this problem.

Signed-off-by: Wen Congyang <wency@...fujitsu.com>
---
 mm/vmscan.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 347b3ff..1e8e2aa 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2953,6 +2953,7 @@ int kswapd_run(int nid)
 		/* failure at boot is fatal */
 		BUG_ON(system_state == SYSTEM_BOOTING);
 		printk("Failed to start kswapd on node %d\n",nid);
+		pgdat->kswapd = NULL;
 		ret = -1;
 	}
 	return ret;
-- 
1.7.1
--
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