From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754574Ab1JOTFO (ORCPT ); Sat, 15 Oct 2011 15:05:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57565 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754417Ab1JOTFM (ORCPT ); Sat, 15 Oct 2011 15:05:12 -0400 Date: Sat, 15 Oct 2011 21:00:37 +0200 From: Oleg Nesterov To: Srikar Dronamraju Cc: Peter Zijlstra , Ingo Molnar , Steven Rostedt , Linux-mm , Arnaldo Carvalho de Melo , Linus Torvalds , Jonathan Corbet , Masami Hiramatsu , Hugh Dickins , Christoph Hellwig , Ananth N Mavinakayanahalli , Thomas Gleixner , Andi Kleen , Andrew Morton , Jim Keniston , Roland McGrath , LKML Subject: [PATCH 1/X] uprobes: write_opcode: the new page needs PG_uptodate Message-ID: <20111015190037.GB30243@redhat.com> References: <20110920115938.25326.93059.sendpatchset@srdronam.in.ibm.com> <20111015190007.GA30243@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111015190007.GA30243@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org write_opcode()->__replace_page() installs the new anonymous page, this new_page is PageSwapBacked() and it can be swapped out. However it forgets to do SetPageUptodate(), fix write_opcode(). For example, this is needed if do_swap_page() finds that orginial page in the the swap cache (and doesn't try to read it back), in this case it returns VM_FAULT_SIGBUS. --- kernel/uprobes.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/kernel/uprobes.c b/kernel/uprobes.c index 3928bcc..52b20c8 100644 --- a/kernel/uprobes.c +++ b/kernel/uprobes.c @@ -200,6 +200,8 @@ static int write_opcode(struct task_struct *tsk, struct uprobe * uprobe, goto put_out; } + __SetPageUptodate(new_page); + /* * lock page will serialize against do_wp_page()'s * PageAnon() handling -- 1.5.5.1