Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1839917ybh; Sun, 8 Mar 2020 14:39:50 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuZsGMLgb6SZIlrl6sgVMozbp4JSV0muO8z6aLrhQINmxu4l+/re04R+2t9VRKRFRyRZpYz X-Received: by 2002:aca:110f:: with SMTP id 15mr9166819oir.114.1583703590144; Sun, 08 Mar 2020 14:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583703590; cv=none; d=google.com; s=arc-20160816; b=r+rI43u8XDq3OGMDDCU0LFNZMQDXPph2U0dlPE8WnF4XZ59ePNDrcUgTzeYTKoIwi5 5dBEepAmvaZgZKVXsTyDPyALqiuFhXiGmJ+dR9Lf3o96YOhkkqgg77501PPzDE88cZlW vUzUEkk7BXT+gW49czINY4SNN1udjIqXwVJgZ0/jnsYPlDMHkam8FAqi4I+59BYrgYYU qbYLH2RE+U+euybkFk4Rjjlw/MNQT6x3Em120gKOK1/DvjTZJXedF/o3ekd3SrNZj6Ua RiNhOpzTH+1W7oDpWSNYhRwRMR+55VN/r4FcIIZx9RtyLfvnRS3uIKsXlqrc0vNcUoy1 BseQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:in-reply-to:date:references:cc:to:from; bh=mHm/hgj4yYvqQ+UZLocHrd8UWwF56R4WNhtprzMJWAQ=; b=H2xB24nE4/kG3iyV2wChv7X2ijPn9leYYaJnF1Bs3UdrH1fbrNL7pF1RyxwkkLEYA+ jqSzraSdWZWWumk+eNUmNer4FT2qDcAn65Es4USDzT1vq9z+oHma2zFQYpZcdmtLU7Lr UzaAvXqJwltVslI3nm/EW9tgxFk09bpsCi9oVbevE3HuE6tqhpXvcxCo5yA76cEHB4TS 5k2fMovHVbrYLSVQTDO5Rvpjn9LLI1oBd68CYQ/epbjqfzakI7IfXtv/bYAtxGusCzq5 hTpbKgoWDzVV8Ut19WVn7Mz0+0+1cFl86nHvbEWGHJ52mJ7kNtWWrTQHMxr1hYmuctyL W0jA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f204si3213170oia.43.2020.03.08.14.39.38; Sun, 08 Mar 2020 14:39:50 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726467AbgCHVjP (ORCPT + 99 others); Sun, 8 Mar 2020 17:39:15 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:38094 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726346AbgCHVjP (ORCPT ); Sun, 8 Mar 2020 17:39:15 -0400 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.90_1) (envelope-from ) id 1jB3dg-0006F5-8i; Sun, 08 Mar 2020 15:39:12 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=x220.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1jB3df-0006JX-Fb; Sun, 08 Mar 2020 15:39:12 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Bernd Edlinger Cc: Christian Brauner , Kees Cook , Jann Horn , Jonathan Corbet , Alexander Viro , Andrew Morton , Alexey Dobriyan , Thomas Gleixner , Oleg Nesterov , Frederic Weisbecker , Andrei Vagin , Ingo Molnar , "Peter Zijlstra \(Intel\)" , Yuyang Du , David Hildenbrand , Sebastian Andrzej Siewior , Anshuman Khandual , David Howells , James Morris , Greg Kroah-Hartman , Shakeel Butt , Jason Gunthorpe , Christian Kellner , Andrea Arcangeli , Aleksa Sarai , "Dmitry V. Levin" , "linux-doc\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" , "linux-fsdevel\@vger.kernel.org" , "linux-mm\@kvack.org" , "stable\@vger.kernel.org" , "linux-api\@vger.kernel.org" References: <87k142lpfz.fsf@x220.int.ebiederm.org> <875zfmloir.fsf@x220.int.ebiederm.org> <87v9nmjulm.fsf@x220.int.ebiederm.org> <202003021531.C77EF10@keescook> <20200303085802.eqn6jbhwxtmz4j2x@wittgenstein> <87v9nlii0b.fsf@x220.int.ebiederm.org> <87a74xi4kz.fsf@x220.int.ebiederm.org> <87r1y8dqqz.fsf@x220.int.ebiederm.org> <87tv32cxmf.fsf_-_@x220.int.ebiederm.org> <87v9ne5y4y.fsf_-_@x220.int.ebiederm.org> Date: Sun, 08 Mar 2020 16:36:55 -0500 In-Reply-To: <87v9ne5y4y.fsf_-_@x220.int.ebiederm.org> (Eric W. Biederman's message of "Sun, 08 Mar 2020 16:34:37 -0500") Message-ID: <87eeu25y14.fsf_-_@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1jB3df-0006JX-Fb;;;mid=<87eeu25y14.fsf_-_@x220.int.ebiederm.org>;;;hst=in02.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/19vvWGcAS1aLsfnI/zloMbNkjZQWb3n0= 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 sa04.xmission.com X-Spam-Level: X-Spam-Status: No, score=0.5 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TooManySym_01,XMSubLong autolearn=disabled version=3.4.2 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.5000] * 0.7 XMSubLong Long Subject * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa04 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa04 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Bernd Edlinger X-Spam-Relay-Country: X-Spam-Timing: total 297 ms - load_scoreonly_sql: 0.09 (0.0%), signal_user_changed: 4.5 (1.5%), b_tie_ro: 3.0 (1.0%), parse: 1.78 (0.6%), extract_message_metadata: 16 (5.5%), get_uri_detail_list: 1.30 (0.4%), tests_pri_-1000: 23 (7.9%), tests_pri_-950: 1.59 (0.5%), tests_pri_-900: 1.45 (0.5%), tests_pri_-90: 32 (10.7%), check_bayes: 30 (10.2%), b_tokenize: 13 (4.3%), b_tok_get_all: 8 (2.6%), b_comp_prob: 2.6 (0.9%), b_tok_touch_all: 4.9 (1.6%), b_finish: 0.77 (0.3%), tests_pri_0: 194 (65.4%), check_dkim_signature: 0.67 (0.2%), check_dkim_adsp: 2.8 (0.9%), poll_dns_idle: 0.97 (0.3%), tests_pri_10: 4.3 (1.5%), tests_pri_500: 13 (4.3%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH v2 3/5] exec: Move cleanup of posix timers on exec out of de_thread 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These functions have very little to do with de_thread move them out of de_thread an into flush_old_exec proper so it can be more clearly seen what flush_old_exec is doing. Signed-off-by: "Eric W. Biederman" --- fs/exec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/exec.c b/fs/exec.c index ff74b9a74d34..215d86f77b63 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1189,11 +1189,6 @@ static int de_thread(struct task_struct *tsk) /* we have changed execution domain */ tsk->exit_signal = SIGCHLD; -#ifdef CONFIG_POSIX_TIMERS - exit_itimers(sig); - flush_itimer_signals(); -#endif - BUG_ON(!thread_group_leader(tsk)); return 0; @@ -1277,6 +1272,11 @@ int flush_old_exec(struct linux_binprm * bprm) if (retval) goto out; +#ifdef CONFIG_POSIX_TIMERS + exit_itimers(me->signal); + flush_itimer_signals(); +#endif + /* * Make the signal table private. */ -- 2.25.0