From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm@xmission.com (Eric W. Biederman) Subject: [PATCH 00/10] Removing SEND_SIG_FORCED Date: Mon, 03 Sep 2018 22:41:13 +0200 Message-ID: <87musyl3fa.fsf@xmission.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Sender: linux-kernel-owner@vger.kernel.org Cc: Oleg Nesterov , Linus Torvalds , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org List-Id: linux-api@vger.kernel.org SEND_SIG_FORCED has two functions. It forces a pid namespace init to receive a signal it would ordinarily ignore, and it causes a siginfo to not be allocated for a signal. This patchset makes __send_signal a little bit smarter so that it can detect when to apply these optimizations and the senders of signals don't have to worry about them. The coupling of forcing a signal to the pid namespace init and not allocating siginfo resulted in serveral minor bugs where a signal sent by the kernel was marked SI_USER suggesting another userspace process sent that signal. I have cc'd linux-api in case anyone cares about these minor userspace visible differences. Unless someone notices a bug I intend to merge these changes through my tree during the next merge window. While there are numerous fixes here none of them appear to be the kind that fixes real world problems so I don't see any urgency here. Please look read and send my your review. I will be out for about a week so I will address any comments when I get back. Eric W. Biederman (10): signal: Always ignore SIGKILL and SIGSTOP sent to the global init signal: Properly deliver SIGILL from uprobes signal: Properly deliver SIGSEGV from x86 uprobes signal: Always deliver the kernel's SIGKILL and SIGSTOP to a pid namespace init signal: send_sig_all no longer needs SEND_SIG_FORCED signal: Remove the siginfo paramater from kernel_dqueue_signal signal: Don't send siginfo to kthreads. signal: Never allocate siginfo for SIGKILL or SIGSTOP signal: Use SEND_SIG_PRIV not SEND_SIG_FORCED with SIGKILL and SIGSTOP signal: Remove SEND_SIG_FORCED arch/x86/kernel/uprobes.c | 2 +- drivers/tty/sysrq.c | 2 +- drivers/usb/gadget/function/f_mass_storage.c | 4 ++-- fs/jffs2/background.c | 2 +- include/linux/sched/signal.h | 5 ++--- include/trace/events/signal.h | 3 +-- kernel/events/uprobes.c | 4 ++-- kernel/pid_namespace.c | 2 +- kernel/ptrace.c | 4 ++-- kernel/signal.c | 14 +++++++++----- mm/oom_kill.c | 4 ++-- 11 files changed, 24 insertions(+), 22 deletions(-) Eric From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6054EC43334 for ; Mon, 3 Sep 2018 20:41:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 084CD20843 for ; Mon, 3 Sep 2018 20:41:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 084CD20843 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xmission.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728611AbeIDBDS (ORCPT ); Mon, 3 Sep 2018 21:03:18 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:50205 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727501AbeIDBDR (ORCPT ); Mon, 3 Sep 2018 21:03:17 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fwvf1-0005tY-OH; Mon, 03 Sep 2018 14:41:23 -0600 Received: from [105.225.206.69] (helo=x220.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fwvf0-0001RU-L3; Mon, 03 Sep 2018 14:41:23 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Cc: Oleg Nesterov , Linus Torvalds , , Date: Mon, 03 Sep 2018 22:41:13 +0200 Message-ID: <87musyl3fa.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1fwvf0-0001RU-L3;;;mid=<87musyl3fa.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=105.225.206.69;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/y+aTW+dpaHWANlobCtAjOHkbj+D0euZc= X-SA-Exim-Connect-IP: 105.225.206.69 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: [PATCH 00/10] Removing SEND_SIG_FORCED X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SEND_SIG_FORCED has two functions. It forces a pid namespace init to receive a signal it would ordinarily ignore, and it causes a siginfo to not be allocated for a signal. This patchset makes __send_signal a little bit smarter so that it can detect when to apply these optimizations and the senders of signals don't have to worry about them. The coupling of forcing a signal to the pid namespace init and not allocating siginfo resulted in serveral minor bugs where a signal sent by the kernel was marked SI_USER suggesting another userspace process sent that signal. I have cc'd linux-api in case anyone cares about these minor userspace visible differences. Unless someone notices a bug I intend to merge these changes through my tree during the next merge window. While there are numerous fixes here none of them appear to be the kind that fixes real world problems so I don't see any urgency here. Please look read and send my your review. I will be out for about a week so I will address any comments when I get back. Eric W. Biederman (10): signal: Always ignore SIGKILL and SIGSTOP sent to the global init signal: Properly deliver SIGILL from uprobes signal: Properly deliver SIGSEGV from x86 uprobes signal: Always deliver the kernel's SIGKILL and SIGSTOP to a pid namespace init signal: send_sig_all no longer needs SEND_SIG_FORCED signal: Remove the siginfo paramater from kernel_dqueue_signal signal: Don't send siginfo to kthreads. signal: Never allocate siginfo for SIGKILL or SIGSTOP signal: Use SEND_SIG_PRIV not SEND_SIG_FORCED with SIGKILL and SIGSTOP signal: Remove SEND_SIG_FORCED arch/x86/kernel/uprobes.c | 2 +- drivers/tty/sysrq.c | 2 +- drivers/usb/gadget/function/f_mass_storage.c | 4 ++-- fs/jffs2/background.c | 2 +- include/linux/sched/signal.h | 5 ++--- include/trace/events/signal.h | 3 +-- kernel/events/uprobes.c | 4 ++-- kernel/pid_namespace.c | 2 +- kernel/ptrace.c | 4 ++-- kernel/signal.c | 14 +++++++++----- mm/oom_kill.c | 4 ++-- 11 files changed, 24 insertions(+), 22 deletions(-) Eric