Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754114AbcJUFuE (ORCPT ); Fri, 21 Oct 2016 01:50:04 -0400 Received: from terminus.zytor.com ([198.137.202.10]:33188 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750856AbcJUFt7 (ORCPT ); Fri, 21 Oct 2016 01:49:59 -0400 Date: Thu, 20 Oct 2016 22:49:30 -0700 From: tip-bot for Dmitry Safonov Message-ID: Cc: mingo@kernel.org, gorcunov@openvz.org, 0x7f454c46@gmail.com, dsafonov@virtuozzo.com, oleg@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com, kilobyte@angband.pl, tglx@linutronix.de, xemul@virtuozzo.com, mpatocka@redhat.com Reply-To: mpatocka@redhat.com, xemul@virtuozzo.com, tglx@linutronix.de, kilobyte@angband.pl, hpa@zytor.com, linux-kernel@vger.kernel.org, oleg@redhat.com, dsafonov@virtuozzo.com, 0x7f454c46@gmail.com, gorcunov@openvz.org, mingo@kernel.org In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/signal: Remove bogus user_64bit_mode() check from sigaction_compat_abi() Git-Commit-ID: ed1e7db33c3354e4f8b594738c5e793690213b43 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2173 Lines: 52 Commit-ID: ed1e7db33c3354e4f8b594738c5e793690213b43 Gitweb: http://git.kernel.org/tip/ed1e7db33c3354e4f8b594738c5e793690213b43 Author: Dmitry Safonov <0x7f454c46@gmail.com> AuthorDate: Thu, 20 Oct 2016 00:53:08 +0300 Committer: Ingo Molnar CommitDate: Thu, 20 Oct 2016 13:05:15 +0200 x86/signal: Remove bogus user_64bit_mode() check from sigaction_compat_abi() The recent introduction of SA_X32/IA32 sa_flags added a check for user_64bit_mode() into sigaction_compat_abi(). user_64bit_mode() is true for native 64-bit processes and x32 processes. Due to that the function returns w/o setting the SA_X32_ABI flag for X32 processes. In consequence the kernel attempts to deliver the signal to the X32 process in native 64-bit mode causing the process to segfault. Remove the check, so the actual check for X32 mode which sets the ABI flag can be reached. There is no side effect for native 64-bit mode. [ tglx: Rewrote changelog ] Fixes: 6846351052e6 ("x86/signal: Add SA_{X32,IA32}_ABI sa_flags") Reported-by: Mikulas Patocka Tested-by: Adam Borowski Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com> Cc: Dmitry Safonov Cc: Oleg Nesterov Cc: linux-mm@kvack.org Cc: Cyrill Gorcunov Cc: Pavel Emelyanov Link: http://lkml.kernel.org/r/CAJwJo6Z8ZWPqNfT6t-i8GW1MKxQrKDUagQqnZ%2B0%2B697%3DMyVeGg@mail.gmail.com Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/kernel/signal_compat.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/x86/kernel/signal_compat.c b/arch/x86/kernel/signal_compat.c index 40df337..ec1f756 100644 --- a/arch/x86/kernel/signal_compat.c +++ b/arch/x86/kernel/signal_compat.c @@ -105,9 +105,6 @@ void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact) /* Don't let flags to be set from userspace */ act->sa.sa_flags &= ~(SA_IA32_ABI | SA_X32_ABI); - if (user_64bit_mode(current_pt_regs())) - return; - if (in_ia32_syscall()) act->sa.sa_flags |= SA_IA32_ABI; if (in_x32_syscall())