From owner-svn-src-all@FreeBSD.ORG Wed Jul 16 08:55:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15A582EE; Wed, 16 Jul 2014 08:55:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02DF62F46; Wed, 16 Jul 2014 08:55:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6G8trVZ055341; Wed, 16 Jul 2014 08:55:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6G8trUR055340; Wed, 16 Jul 2014 08:55:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407160855.s6G8trUR055340@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 16 Jul 2014 08:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268742 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 08:55:54 -0000 Author: kib Date: Wed Jul 16 08:55:53 2014 New Revision: 268742 URL: http://svnweb.freebsd.org/changeset/base/268742 Log: MFC r268471: For safety, ensure that any consumer of the set_regs() and ptrace_set_pc() use the correct return to userspace using iret. Modified: stable/10/sys/amd64/amd64/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/machdep.c Wed Jul 16 08:52:44 2014 (r268741) +++ stable/10/sys/amd64/amd64/machdep.c Wed Jul 16 08:55:53 2014 (r268742) @@ -1979,7 +1979,9 @@ makectx(struct trapframe *tf, struct pcb int ptrace_set_pc(struct thread *td, unsigned long addr) { + td->td_frame->tf_rip = addr; + set_pcb_flags(td->td_pcb, PCB_FULL_IRET); return (0); } @@ -2079,8 +2081,8 @@ set_regs(struct thread *td, struct reg * tp->tf_fs = regs->r_fs; tp->tf_gs = regs->r_gs; tp->tf_flags = TF_HASSEGS; - set_pcb_flags(td->td_pcb, PCB_FULL_IRET); } + set_pcb_flags(td->td_pcb, PCB_FULL_IRET); return (0); }