From patchwork Sat Apr 28 14:06:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Eric W. Biederman" X-Patchwork-Id: 906141 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=xmission.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="W1uNOVoP"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40YFcr39Pnz9s0x for ; Sun, 29 Apr 2018 01:50:20 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Lch/cstoaIS1Ap6SSLUWH9MH5/bjh2fwXmtcNqjVRNE=; b=W1uNOVoP4VoWLy 36T0XYHpRIoguJLk9bUIWj4MiO4JfDwBnKM3qQSfM2L+f7oIBaMAFdv0OttI05AlknWh0a8FTPCmG IKeXJfXw4PaLECncccHvTSzh8xeLWtupu6tHkf1My1vhc1lJAFMPKpJf1smPXA4AO0pUrvweZxRx5 s2sB5HZE5XxHcsT/sjvbcD9GFRghBhvOYPdl2/3b6qTFAxL+qXhCJhqkXlvfoyh7zHIu142Hbd3XQ 2wynHk25xX08FzdPXuYH5cWzOi7mMaBW0oTy9/kJwFFSl07N9kZKUymhNIww0Mut7XPcRFDrwAA7E JE2vI0zXji/PgW7iEZTA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fCS77-0007oT-K8; Sat, 28 Apr 2018 15:50:17 +0000 Received: from out03.mta.xmission.com ([166.70.13.233]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fCQVm-0006sT-3P for linux-um@lists.infradead.org; Sat, 28 Apr 2018 14:07:39 +0000 Received: from in02.mta.xmission.com ([166.70.13.52]) by out03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fCQVe-0004bq-3H; Sat, 28 Apr 2018 08:07:30 -0600 Received: from [68.116.237.29] (helo=x220.home) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fCQVd-0002Sz-Ci; Sat, 28 Apr 2018 08:07:29 -0600 From: "Eric W. Biederman" To: Linux-Arch Date: Sat, 28 Apr 2018 09:06:59 -0500 Message-Id: <20180428140702.3925-2-ebiederm@xmission.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <87zi1nctut.fsf_-_@xmission.com> References: <87zi1nctut.fsf_-_@xmission.com> X-XM-SPF: eid=1fCQVd-0002Sz-Ci; ; ; mid=<20180428140702.3925-2-ebiederm@xmission.com>; ; ; hst=in02.mta.xmission.com; ; ; ip=68.116.237.29; ; ; frm=ebiederm@xmission.com; ; ; spf=neutral X-XM-AID: U2FsdGVkX1/PMOjTeFgdyvhdIJ6JUGBi75jl1yKzx0E= X-SA-Exim-Connect-IP: 68.116.237.29 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa06.xmission.com X-Spam-Level: ** X-Spam-Status: No, score=2.8 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE, TR_Symld_Words, XMNoVowels autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 1.5 XMNoVowels Alpha-numberic number with no vowels * 1.5 TR_Symld_Words too many words that have symbols inside * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4969] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Linux-Arch X-Spam-Relay-Country: X-Spam-Timing: total 247 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 2.8 (1.1%), b_tie_ro: 1.89 (0.8%), parse: 0.83 (0.3%), extract_message_metadata: 9 (3.8%), get_uri_detail_list: 1.14 (0.5%), tests_pri_-1000: 6 (2.2%), tests_pri_-950: 1.13 (0.5%), tests_pri_-900: 0.97 (0.4%), tests_pri_-400: 33 (13.3%), check_bayes: 32 (12.9%), b_tokenize: 6 (2.4%), b_tok_get_all: 16 (6.5%), b_comp_prob: 1.71 (0.7%), b_tok_touch_all: 2.5 (1.0%), b_finish: 0.51 (0.2%), tests_pri_0: 188 (76.1%), check_dkim_signature: 0.44 (0.2%), check_dkim_adsp: 2.8 (1.2%), tests_pri_500: 3.5 (1.4%), rewrite_mail: 0.00 (0.0%) Subject: [REVIEW][PATCH 2/5] signal/signalfd: Add support for SIGSYS X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180428_070738_192471_66D4CD35 X-CRM114-Status: UNSURE ( 8.22 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [166.70.13.233 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record X-Mailman-Approved-At: Sat, 28 Apr 2018 08:50:16 -0700 X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: user-mode-linux-devel@lists.sourceforge.net, Richard Weinberger , Richard Weinberger , Jeff Dike , linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?q?Martin_P=C3=A4rtel?= , "Eric W. Biederman" , Anton Ivanov MIME-Version: 1.0 Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org I don't know why signalfd has never grown support for SIGSYS but grow it now. This corrects an oversight and removes a need for a default in the switch statement. Allowing gcc to warn when future members are added to the enum siginfo_layout, and signalfd does not handle them. Signed-off-by: "Eric W. Biederman" --- fs/signalfd.c | 6 +++++- include/uapi/linux/signalfd.h | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/fs/signalfd.c b/fs/signalfd.c index 31e960209a08..f652249f59f9 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c @@ -134,7 +134,6 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo, new.ssi_stime = kinfo->si_stime; break; case SIL_RT: - default: /* * This case catches also the signals queued by sigqueue(). */ @@ -143,6 +142,11 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo, new.ssi_ptr = (long) kinfo->si_ptr; new.ssi_int = kinfo->si_int; break; + case SIL_SYS: + new.ssi_call_addr = (long) kinfo->si_call_addr; + new.ssi_syscall = kinfo->si_syscall; + new.ssi_arch = kinfo->si_arch; + break; } if (copy_to_user(uinfo, &new, sizeof(struct signalfd_siginfo))) diff --git a/include/uapi/linux/signalfd.h b/include/uapi/linux/signalfd.h index 6f0da42fc5ef..83429a05b698 100644 --- a/include/uapi/linux/signalfd.h +++ b/include/uapi/linux/signalfd.h @@ -35,6 +35,10 @@ struct signalfd_siginfo { __u64 ssi_stime; __u64 ssi_addr; __u16 ssi_addr_lsb; + __u16 __pad2; + __s32 ssi_syscall; + __u64 ssi_call_addr; + __u32 ssi_arch; /* * Pad strcture to 128 bytes. Remember to update the @@ -45,7 +49,7 @@ struct signalfd_siginfo { * comes out of a read(2) and we really don't want to have * a compat on read(2). */ - __u8 __pad[46]; + __u8 __pad[28]; };