Received: by 10.192.165.148 with SMTP id m20csp618353imm; Wed, 25 Apr 2018 05:13:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx48Csd0Bhq3IcOYh57SJnO2ei/aTiINHACaXeK0ohk0HDDnNc16YX0nasevIu5SZH2H+OVbW X-Received: by 2002:a17:902:708a:: with SMTP id z10-v6mr29649125plk.315.1524658412583; Wed, 25 Apr 2018 05:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524658412; cv=none; d=google.com; s=arc-20160816; b=xx79VE54zT5rqzAFHYGB3Tq0sk5qKmYaRXH9v8tGmyjaAVBvcQtg2qgmjV3pVQQznp 9YuK3FzaVOeMhBFLInDlc+AQQQj2M+56Cu2S9P8gTOCCOO9hjuQTxZuOmNwcvx11kVsA vJjixksZLRtzvuGaoVHG/VtSjkAvOyBZNs0+Q3BSv95oghDhs7P1JbD1H3VwLgM2A0qF 0aHaThsvyO2Q+rW6XbXWmuZYT9D07PJbx5V5MCyReUWwnHN+SXY6f7fxxPlXNTVr6lgg bernuIlkOx/sXKfc7Eb2KNvOQRiKd1kRAxFmkFnFb2kZ+3QyJ63iukD3HqoRhxC+reah zTYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=LGNVTAbIXGrag0yXo+rRNRR23y3haydcP8uHDBKnqnI=; b=h4Ot9yphESlgYyiVfl0exP7Kfsxkvdx2fr208fsx/vSvpG91le+fTuhw1Aklp6bh7+ rcum2dBOr65WJKMo+w+pBfVy3Yw2mMgbG25Cnahra/eAhiwx+7CILjv6pP3RfhXGJmhJ tAbC/EcvHaTf3m7iBQkjYV0qyqIBuClqxedZ/qmwUIEF+ryV31Fm192sCkF9PAO8WVqe f+qhQ9YhkycajmE50DUfoVo0T94rYOCymT1cDaJ87jI+bY6i0QF7v+hiiB+8tDElebJ5 aFDl0P02BEa2Hj6mTbGAPemv9Ow0FKAbdrcYk8d+50CtMd9ZziF7kFsNz8iQ2O6gPgjI AITw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DelT+UNv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u123si45964pfu.322.2018.04.25.05.13.18; Wed, 25 Apr 2018 05:13:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DelT+UNv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753611AbeDYMLg (ORCPT + 99 others); Wed, 25 Apr 2018 08:11:36 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:35456 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753256AbeDYMKX (ORCPT ); Wed, 25 Apr 2018 08:10:23 -0400 Received: by mail-io0-f195.google.com with SMTP id d26-v6so26519157ioc.2; Wed, 25 Apr 2018 05:10:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=LGNVTAbIXGrag0yXo+rRNRR23y3haydcP8uHDBKnqnI=; b=DelT+UNvpXbSllP9tsmOJ8gX8peXsB3YZTfjBF28R9B+D5MPZetE9lTsPZKSj81ETv j2xh1iK88IJwJ7Z0/2Y0KAkKFXCqEgq4OvCzmZ5G+EKXpm/nzx5GiPxCwB9fgqKVfdMd mMKlW9f6HLkJQDEvYznQBeoCsB7umXsHR1mW6oxY6gTfay/ZNaF+UfjTIwHjNidSXcGk 1lgxXiXLJsYqLCl4W61IZ5WVB/iLSKdSyqvFTDi0va+DDCTAgFz1p0qFj+AVZJEbNhdY l780hQlrH8myF/OKnxa6llMJkc6rfOrU/zTN0x9upOV18x4boVzNAQb0V3YEgcr6SDcT CN9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=LGNVTAbIXGrag0yXo+rRNRR23y3haydcP8uHDBKnqnI=; b=JykYrp0HEZqE8FRSVGjeKKOV4h2AVzlWY4Gm09F2QmeYMIEo5mxwAcP+Jx69WL7rQo /KF/9umITfQXY+k4qPC1V2WIOmzJ0HIj7mBp0xhuEfI3i3bBUzdazitxWJrBR7qxvzYp tbFqL4ILMnp+FNMpmDx2cHShk7xFxebWmTcVL8LsrBWoDkssNW7H1FJXeFLOlsID6GSV P01iuknHyonDRJAy4rr6oPP+5gXOCyX0ZVOtdtnUC43AowM1qas2aCrji7H/fwgY1Rxo K5ew9KRgtSl1yy6Y/amxq6FSXOoWONJrv/wBHf4XXtjp43anTfaryttSfhOA+eIkusdn zxSg== X-Gm-Message-State: ALQs6tD2SlQFq3G74kIyci5fLcjjbz0HGi9VRJhdj3Z5/ScjrgYTcdxt btbgMj2KWqwakORZAup0sNASipUFOJu2ctRk/U4= X-Received: by 2002:a6b:37c1:: with SMTP id e184-v6mr29333428ioa.102.1524658222544; Wed, 25 Apr 2018 05:10:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.29.132 with HTTP; Wed, 25 Apr 2018 05:10:22 -0700 (PDT) In-Reply-To: <20180420010408.24438-5-ebiederm@xmission.com> References: <878t9ilmhv.fsf@xmission.com> <20180420010408.24438-5-ebiederm@xmission.com> From: Vincent Chen Date: Wed, 25 Apr 2018 20:10:22 +0800 Message-ID: Subject: Re: [REVIEW][PATCH 05/17] signal/nds32: Use force_sig(SIGILL) in do_revisn To: "Eric W. Biederman" Cc: linux-arch , Linux Kernel Mailing List , linux-api@vger.kernel.org, Vincent Chen , Greentime Hu , Arnd Bergmann Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-04-20 9:03 GMT+08:00 Eric W. Biederman : > As originally committed do_revisn would deliver a siginfo for SIGILL > with an si_code composed of random stack contents. That makes no > sense and is not something userspace can depend on. So simplify > the code and just use "force_sig(SIG_ILL, current)" instead. > > Fixes: 2923f5ea7738 ("nds32: Exception handling") > Cc: Vincent Chen > Cc: Greentime Hu > Cc: Arnd Bergmann > Signed-off-by: "Eric W. Biederman" > --- > arch/nds32/kernel/traps.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/arch/nds32/kernel/traps.c b/arch/nds32/kernel/traps.c > index 65961bf91d64..8e9a5b1f6234 100644 > --- a/arch/nds32/kernel/traps.c > +++ b/arch/nds32/kernel/traps.c > @@ -356,14 +356,11 @@ void do_dispatch_tlb_misc(unsigned long entry, unsigned long addr, > > void do_revinsn(struct pt_regs *regs) > { > - siginfo_t si; > pr_emerg("Reserved Instruction\n"); > show_regs(regs); > if (!user_mode(regs)) > do_exit(SIGILL); > - si.si_signo = SIGILL; > - si.si_errno = 0; > - force_sig_info(SIGILL, &si, current); > + force_sig(SIGILL, current); > } > > #ifdef CONFIG_ALIGNMENT_TRAP > -- > 2.14.1 > You are right we do not store any valuable information in sigingo_t now. However, We hope more information can be recorded by force_sig_fault() as below instead of calling force_sig() directly. - force_sig(SIGILL, current); + force_sig_fault(SIGILL, ILL_ILLTRP, + (void __user *)instruction_pointer(regs), current); Thanks Vincent Chen