Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1067976ybh; Tue, 10 Mar 2020 14:00:01 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsIX8agdrAZVdZXQyKIUhdIlMFBRMv9a7eipADG2MIqPXY10ug0omU8x0/19OcVIopcB11W X-Received: by 2002:a05:6808:14d:: with SMTP id h13mr2646791oie.121.1583874001838; Tue, 10 Mar 2020 14:00:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583874001; cv=none; d=google.com; s=arc-20160816; b=wNafq9YlJnLxFjz72tWLe6RY58g/lcclwnMSVhfiQTcevpN1Qj0zcrm8xFweJPhGc+ +0+fbflSKKHS5jkXS51V2NXyw4rlG+7uFg6bscjv5lXGukpvYjqU2B2ttGoAnMHbb3gz KyckVn2uoi3CcJPSA/Og4ZjfDzT7apYKT+q8X1ee59ILIjZ6fk4YieBiGk2q2GMXvJ8P kif2UaI7W8fJBIzSYbsC/1oPcUY9Xa6YDaFjps9PsxI7nbFEx9wH03fltlupSKv6J0Lb 00zkxcgBCE3NHJSCOK+cdO1kQyEkxDGWQPtkQgCiPbP+EwFS3XuqUjDrBGsNieQcClE3 0bHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=h/UHe/Z2KYMMhMaL8b+qDKyko05KbGSgYzdkzaqTp1Q=; b=U53hkK/2gWKDL6J6qUEXtbyi9nv9gw4QyYxuV16BqcXqY34kgXVufhKEg+R/mLLrAe ASxzNKRWfw2vVpW2JkjmeNZwVn8/3O+bUsEgfUx6r5Wk6jzAUToxn7A0yBLmpLKfKhi+ dQaUkjQSr+jmRgWD1F4IxWCNlXZLHyO3q8+dBbr/dkmUg2VnzUi0EnoxEkLJUM6v2p4k O+Kh6/RLAdPvtKaH+tJNoE4wWj2Tn4t+9Ves2pGhxd3+syK9rSxPgdFe8o0WJaeyNO0F Xe7npStgUDCUHavjVPxINrMCchIyT5QtCdYLR2oXSBFyQ6kkspistQvxl2BC5KKahmWg Mspw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=f3d2SeYQ; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h25si1228oie.192.2020.03.10.13.59.48; Tue, 10 Mar 2020 14:00:01 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=f3d2SeYQ; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727280AbgCJU6S (ORCPT + 99 others); Tue, 10 Mar 2020 16:58:18 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:39606 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726283AbgCJU6S (ORCPT ); Tue, 10 Mar 2020 16:58:18 -0400 Received: by mail-oi1-f195.google.com with SMTP id d63so8603435oig.6 for ; Tue, 10 Mar 2020 13:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=h/UHe/Z2KYMMhMaL8b+qDKyko05KbGSgYzdkzaqTp1Q=; b=f3d2SeYQpgVLrJGn+2fJsyTeZ33RbVfXHprKDGfMDVqGkosVqqxK/2QXtZccWWFuRj 3H1Vuq4RzFKICAJIacPrBnjEijgIAt06KHj7SPbMytEDqSc2bQCFpebWWEhlsNbb9CQg 0EENSDiMqajsXSRPNxRgfWg0lSNXm01HzaC2Q189Cu68mrW/BbRm8UCiSyi/wK9LxpS6 2v8SST6X243GaY75zF1ejIgXl1Ziq9i2BGhV2I5VVTBY9HyN2WhdvxYYHsUo+yxyBCvr aBlu3LRwvU/UnCu6xf8M8cmA31C/oA+zYoaj/I7R69+QrHOXlVUvmKSQJ/HHZdO+QW+x of0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h/UHe/Z2KYMMhMaL8b+qDKyko05KbGSgYzdkzaqTp1Q=; b=FNaNTRKghdcjYXNFpN6JRHI3OeVIqqmJVXa+mEEqrLYME914gZX0nY34FxHG2yXO1p L1bSIot+2U3rwFhEMWRLyS/6FWJuTmsBjMwAXyi5mawNR3fFRO7m4iN7b8OAy1xqMaQU Qqa3amGP9bqEuX6q2+hqJFb/ZyYEIjBJrU22L8LQ7x5W/z8k/m+i+P3E+kdVl2K6rcMe FK+E99ToMAArkH6RKMacn7hdLZx8Xnwtvn/3o7Th/WdfECDdx2BZda1cXNbMGq50P7oS cqbADx+ORPvAzmeOiznW5uKw7nimaXMP6LlmlcI557uVGY+/GnEXPVczCdS4a/Vlfgxd qm8Q== X-Gm-Message-State: ANhLgQ1uvzo1sifcWRUVeyawY1sfh+Yhhv7mAyR5O5O/MuJI1/OieLW6 jxngWUf0Rc8CucBTJ98886kMua2P55K+DOLq1x4pCw== X-Received: by 2002:aca:b187:: with SMTP id a129mr2648252oif.175.1583873897432; Tue, 10 Mar 2020 13:58:17 -0700 (PDT) MIME-Version: 1.0 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> <87eeu25y14.fsf_-_@x220.int.ebiederm.org> In-Reply-To: <87eeu25y14.fsf_-_@x220.int.ebiederm.org> From: Jann Horn Date: Tue, 10 Mar 2020 21:57:50 +0100 Message-ID: Subject: Re: [PATCH v2 3/5] exec: Move cleanup of posix timers on exec out of de_thread To: "Eric W. Biederman" Cc: Bernd Edlinger , Christian Brauner , Kees Cook , 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" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 8, 2020 at 10:39 PM Eric W. Biederman wrote: > 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 nit: exit_itimers() has a comment referring to de_thread, that should probably be updated