From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: Re: [PATCH][v4] uprobes/x86: emulate push insns for uprobe on x86 Date: Fri, 17 Nov 2017 18:25:26 +0100 Message-ID: <20171117172526.GA10949@redhat.com> References: <20171115175928.3821714-1-yhs@fb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: mingo@kernel.org, tglx@linutronix.de, peterz@infradead.org, linux-kernel@vger.kernel.org, x86@kernel.org, netdev@vger.kernel.org, ast@fb.com, kernel-team@fb.com To: Yonghong Song Return-path: Received: from mx1.redhat.com ([209.132.183.28]:42126 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751676AbdKQRZ3 (ORCPT ); Fri, 17 Nov 2017 12:25:29 -0500 Content-Disposition: inline In-Reply-To: <20171115175928.3821714-1-yhs@fb.com> Sender: netdev-owner@vger.kernel.org List-ID: On 11/15, Yonghong Song wrote: > > v3 -> v4: > . Revert most of v3 change as 32bit emulation is not really working > on x86_64 platform as among other issues, function emulate_push_stack() > needs to account for 32bit app on 64bit platform. > A separate effort is ongoing to address this issue. Reviewed-by: Oleg Nesterov Please test your patch with the fix below, in this particular case the TIF_IA32 check should be fine. Although this is not what we really want, we should probably use user_64bit_mode(regs) which checks ->cs. But this needs more changes and doesn't solve other problems (get_unmapped_area) so I still can't decide what should we do right now... Oleg. --- a/arch/x86/kernel/uprobes.c +++ b/arch/x86/kernel/uprobes.c @@ -516,7 +516,7 @@ struct uprobe_xol_ops { static inline int sizeof_long(void) { - return in_ia32_syscall() ? 4 : 8; + return test_thread_flag(TIF_IA32) ? 4 : 8; } static int default_pre_xol_op(struct arch_uprobe *auprobe, struct pt_regs *regs)