From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751841AbcFSWV5 (ORCPT ); Sun, 19 Jun 2016 18:21:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52740 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751283AbcFSWVt (ORCPT ); Sun, 19 Jun 2016 18:21:49 -0400 Date: Sun, 19 Jun 2016 23:19:07 +0200 From: Oleg Nesterov To: Andy Lutomirski Cc: x86@kernel.org, "linux-kernel@vger.kernel.org" , Kees Cook , Borislav Petkov Subject: Re: [PATCH] x86/ptrace: Remove questionable TS_COMPAT usage in ptrace Message-ID: <20160619211906.GA14712@redhat.com> References: <94bda8cd5f326ae5591c80fb5d7c1c22624accec.1466244711.git.luto@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <94bda8cd5f326ae5591c80fb5d7c1c22624accec.1466244711.git.luto@kernel.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sun, 19 Jun 2016 22:21:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let me first thank Pedro who has already replied! And I have to admit I will need to re-read his explanations after sleep to (try to) convince myself I fully understans the problems ;) Too late for me. Right now I have nothing to add, but On 06/18, Andy Lutomirski wrote: > > @@ -922,16 +922,7 @@ static int putreg32(struct task_struct *child, unsigned regno, u32 value) > R32(esp, sp); > > case offsetof(struct user32, regs.orig_eax): > - /* > - * A 32-bit debugger setting orig_eax means to restore > - * the state of the task restarting a 32-bit syscall. > - * Make sure we interpret the -ERESTART* codes correctly > - * in case the task is not actually still sitting at the > - * exit from a 32-bit syscall with TS_COMPAT still set. > - */ > regs->orig_ax = value; > - if (syscall_get_nr(child, regs) >= 0) > - task_thread_info(child)->status |= TS_COMPAT; I agree it would be nice to remove this code, but then it is not clear how/when we should sign-extend regs->ax.. And this leads to another question, why do we actually need to set/clear TS_COMPAT in set_personality_ia32() ?? Oleg.