From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Serge E. Hallyn" Subject: Re: [PATCH] c/r: tolerate X86_EFLAGS_RF on restart Date: Thu, 29 Oct 2009 09:31:25 -0500 Message-ID: <20091029143125.GE15713@us.ibm.com> References: <1256323024-20268-1-git-send-email-orenl@librato.com> <20091026145746.GA23564@us.ibm.com> <4AE8EDC4.5010202@librato.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <4AE8EDC4.5010202-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Oren Laadan Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Avi Kivity , Alexey Dobriyan List-Id: containers.vger.kernel.org Quoting Oren Laadan (orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org): > > After reading the code a bit more, and seeing that: > > 1) ptrace uses the debugreg of a process so may be interested in > that particular flag, and > > 2) even without ptrace userspace can set that flag (by suitably > setting the restore context from a signal handler) > > I now think that we should instead: > > 1) Keep the X86_EFLAGS_RF from the time of checkpoint *as is* > > 2) If the restarting task already has this flag set prior to > restoring eflags from the saved value, then preserve the existing > flag even if at the time of checkpoint it wasn't set. > > Unless someones yells, I'll commit this soon. As it stands (looking at arch/x86/kernel/ptrace.c) it looks like userspace with no privilege can set the bit right? I think your proposal sounds best. -serge