From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932972AbcFLMjf (ORCPT ); Sun, 12 Jun 2016 08:39:35 -0400 Received: from szxga04-in.huawei.com ([119.145.14.52]:53139 "EHLO szxga04-in.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932156AbcFLMjd (ORCPT ); Sun, 12 Jun 2016 08:39:33 -0400 Subject: Re: [PATCH 21/23] arm64: ilp32: introduce ilp32-specific handlers for sigframe and ucontext To: Yury Norov , , , , , , , , References: <1464048292-30136-1-git-send-email-ynorov@caviumnetworks.com> <1464048292-30136-22-git-send-email-ynorov@caviumnetworks.com> CC: , , , , , , , , , , , , , , "Andrew Pinski" , Andrew Pinski , Hanjun Guo , "Zhangjian (Bamvor)" From: "Zhangjian (Bamvor)" Message-ID: <575D57E4.6020709@huawei.com> Date: Sun, 12 Jun 2016 20:39:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1464048292-30136-22-git-send-email-ynorov@caviumnetworks.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.72.170] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.575D57F2.014F,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 17951ba79ac8b4969aa89c8fe62dfbac Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Yury Here is another print issue in this patch: On 2016/5/24 8:04, Yury Norov wrote: > From: Andrew Pinski > > ILP32 uses AARCH32 compat structures and syscall handlers for signals. > But ILP32 struct rt_sigframe and ucontext differs from both LP64 and > AARCH32. So some specific mechanism is needed to take care of it. > [...] > diff --git a/arch/arm64/kernel/signal_ilp32.c b/arch/arm64/kernel/signal_ilp32.c > new file mode 100644 > index 0000000..841e8f8 > --- /dev/null > +++ b/arch/arm64/kernel/signal_ilp32.c > @@ -0,0 +1,192 @@ > +/* [...] > +asmlinkage long ilp32_sys_rt_sigreturn(struct pt_regs *regs) > +{ > + struct ilp32_rt_sigframe __user *frame; > + > + /* Always make any pending restarted system calls return -EINTR */ > + current->restart_block.fn = do_no_restart_syscall; > + > + /* > + * Since we stacked the signal on a 128-bit boundary, > + * then 'sp' should be word aligned here. If it's > + * not, then the user is trying to mess with us. > + */ > + if (regs->sp & 15) > + goto badframe; > + > + frame = (struct ilp32_rt_sigframe __user *)regs->sp; > + > + if (!access_ok(VERIFY_READ, frame, sizeof (*frame))) > + goto badframe; > + > + if (restore_ilp32_sigframe(regs, &frame->sig)) > + goto badframe; > + > + if (compat_restore_altstack(&frame->sig.uc.uc_stack)) > + goto badframe; > + > + return regs->regs[0]; > + > +badframe: > + if (show_unhandled_signals) > + pr_info_ratelimited("%s[%d]: bad frame in %s: pc=%08llx sp=%08llx\n", > + current->comm, task_pid_nr(current), __func__, > + regs->pc, regs->compat_sp); It should be sp instead of compat_sp. The latter one is used by aarch32 EE. Regards Bamvor > + force_sig(SIGSEGV, current); > + return 0; > +} > +