Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261174AbVEWXk5 (ORCPT ); Mon, 23 May 2005 19:40:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261245AbVEWXcN (ORCPT ); Mon, 23 May 2005 19:32:13 -0400 Received: from fire.osdl.org ([65.172.181.4]:47238 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S261184AbVEWXaK (ORCPT ); Mon, 23 May 2005 19:30:10 -0400 Date: Mon, 23 May 2005 16:29:18 -0700 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Chuck Wolber , torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk, ak@suse.de Subject: [patch 12/16] x86_64: check if ptrace RIP is canonical Message-ID: <20050523232918.GX27549@shell0.pdx.osdl.net> References: <20050523231529.GL27549@shell0.pdx.osdl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050523231529.GL27549@shell0.pdx.osdl.net> User-Agent: Mutt/1.5.6i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1138 Lines: 34 [PATCH] x86_64: check if ptrace RIP is canonical This works around an AMD Erratum. Signed-off-by: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Chris Wright --- ptrace.c | 5 +++++ 1 files changed, 5 insertions(+) Index: release-2.6.11/arch/x86_64/kernel/ptrace.c =================================================================== --- release-2.6.11.orig/arch/x86_64/kernel/ptrace.c +++ release-2.6.11/arch/x86_64/kernel/ptrace.c @@ -149,6 +149,11 @@ static int putreg(struct task_struct *ch return -EIO; value &= 0xffff; break; + case offsetof(struct user_regs_struct, rip): + /* Check if the new RIP address is canonical */ + if (value >= TASK_SIZE) + return -EIO; + break; } put_stack_long(child, regno - sizeof(struct pt_regs), value); return 0; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/