Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751922AbdFFTLy (ORCPT ); Tue, 6 Jun 2017 15:11:54 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:51343 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751671AbdFFTLr (ORCPT ); Tue, 6 Jun 2017 15:11:47 -0400 From: "Eric W. Biederman" To: linux-kernel@vger.kernel.org Cc: linux-api@vger.kernel.org, Linus Torvalds , Oleg Nesterov , Ingo Molnar , Thomas Gleixner , Kees Cook , Roland McGrath , Al Viro , David Howells , "Michael Kerrisk (man-pages)" , "Eric W. Biederman" Date: Tue, 6 Jun 2017 14:03:15 -0500 Message-Id: <20170606190338.28347-3-ebiederm@xmission.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20170606190338.28347-1-ebiederm@xmission.com> References: <877f0pym71.fsf@xmission.com> <20170606190338.28347-1-ebiederm@xmission.com> X-XM-SPF: eid=1dIJt4-0006wd-MX;;;mid=<20170606190338.28347-3-ebiederm@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=97.121.81.159;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/x+Nd5aQzNUvV9Mhcw6AyUFLHiPjGQ3lE= X-SA-Exim-Connect-IP: 97.121.81.159 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa05 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa05 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;linux-kernel@vger.kernel.org X-Spam-Relay-Country: X-Spam-Timing: total 5551 ms - load_scoreonly_sql: 0.08 (0.0%), signal_user_changed: 3.6 (0.1%), b_tie_ro: 2.5 (0.0%), parse: 1.34 (0.0%), extract_message_metadata: 18 (0.3%), get_uri_detail_list: 2.9 (0.1%), tests_pri_-1000: 8 (0.2%), tests_pri_-950: 1.49 (0.0%), tests_pri_-900: 1.25 (0.0%), tests_pri_-400: 26 (0.5%), check_bayes: 24 (0.4%), b_tokenize: 8 (0.2%), b_tok_get_all: 8 (0.2%), b_comp_prob: 2.8 (0.1%), b_tok_touch_all: 3.0 (0.1%), b_finish: 0.62 (0.0%), tests_pri_0: 174 (3.1%), check_dkim_signature: 0.60 (0.0%), check_dkim_adsp: 3.0 (0.1%), tests_pri_500: 5314 (95.7%), poll_dns_idle: 5304 (95.5%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH 03/26] signal: Do not perform permission checks when sending pdeath_signal 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) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1770 Lines: 46 This fixes and old old regression. When Roland switched from sending pdeath_signal with send_sig() to send_group_sig_info it gained a permission check, and started taking the tasklist lock. Roland earlier fixed the double taking of the tasklist lock in 3f2a0d1df938 ("[PATCH] fix pdeath_signal SMP locking") but pdeath_signal still performs an unnecessary permission check. Ordinarily I would be hesitant at fixing an ancient regression but a permission check for our parent sending to us is almost never likely to fail (so it is unlikely anyone has noticed), and it is stupid. It makes absolutely no sense to see if our parent has permission to send us a signal we requested be sent to us. As this is more permisssive there is no chance anything will break. The information of if our parent is living is available elsewhere getppid, tkill, and proc with no special permissions so this should not be an information leak. See https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/ for the bitkeeper era history that I refer to. Fixes: da334d91ff70 ("[PATCH] linux-2.5.66-signal-cleanup.patch") Signed-off-by: "Eric W. Biederman" --- kernel/exit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/exit.c b/kernel/exit.c index 516acdb0e0ec..8926cdd132f2 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -692,8 +692,8 @@ static void forget_original_parent(struct task_struct *father, if (likely(!t->ptrace)) t->parent = t->real_parent; if (t->pdeath_signal) - group_send_sig_info(t->pdeath_signal, - SEND_SIG_NOINFO, t); + do_send_sig_info(t->pdeath_signal, + SEND_SIG_NOINFO, t, true); } /* * If this is a threaded reparent there is no need to -- 2.10.1