Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3039339pxy; Mon, 3 May 2021 13:42:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzctKuxxuKlpsYQyvoVyb0mZ2Ah6bqqWWRXv8aIyEmiPhmQXwa0KJGiPDNL8svzaGU1qW0z X-Received: by 2002:aa7:dc4e:: with SMTP id g14mr8839861edu.11.1620074523445; Mon, 03 May 2021 13:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620074523; cv=none; d=google.com; s=arc-20160816; b=CFmUEE2lBBdvr2KwTtB5ExYe+mxVZumL/ogeV5mpS636y/iJwOO24yQkIeYUXFEWdd bDnrb4KgrbSk0cpB5Ko3nCt/YzFLQ/DrLAZl1xHSNX+29sF7SouaJU2evKNcHGSuf+WS TGjTtUA0yTvsrj2s2ieT9D7Q9x3Mk6D9hS/gBeUzy98X0qvwzWWHDAW48qN5q776RxrY 5kcf/DDTCV4WKH3qdk+spIYe4OqV5Fcv9lsbvp5TfPBmpbB+jMdqt+WUUwve/31LZgUx YwT9Ld9bpiEU0R1Jg6aS7qhEMxtjPRO1OFejQKYcHnk4jfaM0/vBFI/lj/54zrEjxPLt OFDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from; bh=ukgaSP3pPa8tfVL0VASNOAnEHqZRqsHN3UWyFjwUWL0=; b=GrkF/4oN6fwowcVBTdkyE3nOgbVJGu0dXr2PsKplT8zoiVtIufza7CWv+2Io6oTp6e 7BSRT/Oa33Zw2/jDKMQtyBMm4+ahPBVqXp/Cz8DpVksmzvAQsqS14YGgi0DF6G9QFAAm VdaQjxN9zanBjxIWXOKIBrBGOYI5dIPEkEntyYJZRchHsK4KtU0n2hxSwX1V6kMqHQ9B Fk+7mwebuO6YtR9kjnN6SXZVPSVM8MMZaxANKAU9YIwhWE3xw7KTBF2pP3QrSHFsPXfY MtaEngZzUabnzffL5bmxdckTS2WN7jJRxaojE0Rctm9tGmcUfoDSqlX7FqJdfRUVFH4a n0PA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si10477529eda.90.2021.05.03.13.41.40; Mon, 03 May 2021 13:42:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229784AbhECUkk (ORCPT + 99 others); Mon, 3 May 2021 16:40:40 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:51174 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229801AbhECUkU (ORCPT ); Mon, 3 May 2021 16:40:20 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]) by out03.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1ldfLi-008idl-2w; Mon, 03 May 2021 14:39:26 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=fess.int.ebiederm.org) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1ldfLh-00E76Y-3k; Mon, 03 May 2021 14:39:25 -0600 From: "Eric W. Beiderman" To: Marco Elver Cc: Arnd Bergmann , Florian Weimer , "David S. Miller" , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Peter Collingbourne , Dmitry Vyukov , Alexander Potapenko , sparclinux , linux-arch , Linux Kernel Mailing List , Linux API , kasan-dev , "Eric W. Biederman" Date: Mon, 3 May 2021 15:38:14 -0500 Message-Id: <20210503203814.25487-12-ebiederm@xmission.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210503203814.25487-1-ebiederm@xmission.com> References: <20210503203814.25487-1-ebiederm@xmission.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-XM-SPF: eid=1ldfLh-00E76Y-3k;;;mid=<20210503203814.25487-12-ebiederm@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18ApcIKZTcHjAhTtt02Vp3dyDFJvqVtnoc= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa02.xmission.com X-Spam-Level: ** X-Spam-Status: No, score=2.5 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01, XMGappySubj_01,XMNoVowels,XMSubLong autolearn=disabled version=3.4.2 X-Spam-Virus: No X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4756] * 0.7 XMSubLong Long Subject * 0.5 XMGappySubj_01 Very gappy subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa02 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa02 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Marco Elver X-Spam-Relay-Country: X-Spam-Timing: total 368 ms - load_scoreonly_sql: 0.02 (0.0%), signal_user_changed: 3.5 (1.0%), b_tie_ro: 2.5 (0.7%), parse: 0.67 (0.2%), extract_message_metadata: 8 (2.1%), get_uri_detail_list: 1.30 (0.4%), tests_pri_-1000: 10 (2.8%), tests_pri_-950: 0.93 (0.3%), tests_pri_-900: 0.81 (0.2%), tests_pri_-90: 56 (15.2%), check_bayes: 55 (14.9%), b_tokenize: 6 (1.7%), b_tok_get_all: 7 (1.8%), b_comp_prob: 1.37 (0.4%), b_tok_touch_all: 38 (10.3%), b_finish: 0.63 (0.2%), tests_pri_0: 278 (75.8%), check_dkim_signature: 0.38 (0.1%), check_dkim_adsp: 2.1 (0.6%), poll_dns_idle: 0.78 (0.2%), tests_pri_10: 1.62 (0.4%), tests_pri_500: 5 (1.5%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH 12/12] signalfd: Remove SIL_FAULT_PERF_EVENT fields from signalfd_siginfo X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Eric W. Biederman" With the addition of ssi_perf_data and ssi_perf_type struct signalfd_siginfo is dangerously close to running out of space. All that remains is just enough space for two additional 64bit fields. A practice of adding all possible siginfo_t fields into struct singalfd_siginfo can not be supported as adding the missing fields ssi_lower, ssi_upper, and ssi_pkey would require two 64bit fields and one 32bit fields. In practice the fields ssi_perf_data and ssi_perf_type can never be used by signalfd as the signal that generates them always delivers them synchronously to the thread that triggers them. Therefore until someone actually needs the fields ssi_perf_data and ssi_perf_type in signalfd_siginfo remove them. This leaves a bit more room for future expansion. Signed-off-by: "Eric W. Biederman" --- fs/signalfd.c | 16 ++++++---------- include/uapi/linux/signalfd.h | 4 +--- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/fs/signalfd.c b/fs/signalfd.c index 335ad39f3900..040e1cf90528 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c @@ -114,12 +114,13 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo, break; case SIL_FAULT_BNDERR: case SIL_FAULT_PKUERR: + case SIL_FAULT_PERF_EVENT: /* - * Fall through to the SIL_FAULT case. Both SIL_FAULT_BNDERR - * and SIL_FAULT_PKUERR are only generated by faults that - * deliver them synchronously to userspace. In case someone - * injects one of these signals and signalfd catches it treat - * it as SIL_FAULT. + * Fall through to the SIL_FAULT case. SIL_FAULT_BNDERR, + * SIL_FAULT_PKUERR, and SIL_FAULT_PERF_EVENT are only + * generated by faults that deliver them synchronously to + * userspace. In case someone injects one of these signals + * and signalfd catches it treat it as SIL_FAULT. */ case SIL_FAULT: new.ssi_addr = (long) kinfo->si_addr; @@ -132,11 +133,6 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo, new.ssi_addr = (long) kinfo->si_addr; new.ssi_addr_lsb = (short) kinfo->si_addr_lsb; break; - case SIL_FAULT_PERF_EVENT: - new.ssi_addr = (long) kinfo->si_addr; - new.ssi_perf_type = kinfo->si_perf_type; - new.ssi_perf_data = kinfo->si_perf_data; - break; case SIL_CHLD: new.ssi_pid = kinfo->si_pid; new.ssi_uid = kinfo->si_uid; diff --git a/include/uapi/linux/signalfd.h b/include/uapi/linux/signalfd.h index e78dddf433fc..83429a05b698 100644 --- a/include/uapi/linux/signalfd.h +++ b/include/uapi/linux/signalfd.h @@ -39,8 +39,6 @@ struct signalfd_siginfo { __s32 ssi_syscall; __u64 ssi_call_addr; __u32 ssi_arch; - __u32 ssi_perf_type; - __u64 ssi_perf_data; /* * Pad strcture to 128 bytes. Remember to update the @@ -51,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[16]; + __u8 __pad[28]; }; -- 2.30.1