Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2764869ybh; Mon, 9 Mar 2020 12:31:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsonk5QCjwT6eh52qL/jLawm6bFlgnCOjsvkyu9xHhm/KLswELZAB35e9SHjCIiwC7DIhgZ X-Received: by 2002:a9d:22:: with SMTP id 31mr13306055ota.173.1583782299630; Mon, 09 Mar 2020 12:31:39 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s15si6848325otd.209.2020.03.09.12.31.26; Mon, 09 Mar 2020 12:31:39 -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; arc=fail (body hash mismatch); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726333AbgCITa6 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 9 Mar 2020 15:30:58 -0400 Received: from mail-oln040092073073.outbound.protection.outlook.com ([40.92.73.73]:43971 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726106AbgCITa5 (ORCPT ); Mon, 9 Mar 2020 15:30:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WQS9JVkpHcFeZxqgH/0JGbj5Cds27H8qPYwSn1Tl1ZxWhWOyD2xr7uNRDfarncOaQc9JL1lrPyvpwpdiT9GvufZHIXYQoEpK8JQ/0UGQJDQI6rJc5X9Pw7DiwFCp275Ax+UpEbalu1I0SzrdLGPwJGiAMks7kWxuMhQpnVm9lXcAfUu6Z+Vze7XkFgZZRFxpoYTFD9ySodW+0tK3u+LhRP4jHhgOGQoQ7h+ol/3M9JO9NZeyPOKUKLuxPYgCg8RbkfYtgBhTgvfWfH0rpqUQBA7R8mcZz+YGWSsjSOgP8Au3BNyQMMl077GdZ3C9gSMZ9N/shlNBXoh2HjQTaZ6Sqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jxx6MlQD/1BAFg8WI2pnsDjsoz3s+EOs2w5Pc/bBL/4=; b=gdqKrYKZ9HZWUqGjiVoL5N87BcFyZurhBCVcW7VQLqJ2Yaft2N4ZE8+3cCTPZJVWDltR2XCYgUYSxEIve/I+CYqWX3f7msLefXNjPcKxFFbnf1GwCjom2MSoSZiODMXPtCiRHc/kdUNrqVXnFytCkxHjG9RyBUqKVkzAEJPHkFGomWbHdGeuIC0F+GXeUrMaxPjmgungJ9JO4+XwAH4q7kPVReaCY7Ew6j8V80Df00JiF2s+kOxg2a1za9tKrrZQ+NfkG3u+KEIK3QMaGopdmWtnaziNKRuMbx9RtRJuURihdzKaRb3srDfojs0ystLcjYaEG//V8m0/ik8b29TzLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from HE1EUR04FT025.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::33) by HE1EUR04HT222.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.11; Mon, 9 Mar 2020 19:30:13 +0000 Received: from AM6PR03MB5170.eurprd03.prod.outlook.com (10.152.26.60) by HE1EUR04FT025.mail.protection.outlook.com (10.152.27.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.11 via Frontend Transport; Mon, 9 Mar 2020 19:30:13 +0000 Received: from AM6PR03MB5170.eurprd03.prod.outlook.com ([fe80::1956:d274:cab3:b4dd]) by AM6PR03MB5170.eurprd03.prod.outlook.com ([fe80::1956:d274:cab3:b4dd%6]) with mapi id 15.20.2772.019; Mon, 9 Mar 2020 19:30:13 +0000 Received: from [192.168.1.101] (92.77.140.102) by AM0PR01CA0025.eurprd01.prod.exchangelabs.com (2603:10a6:208:69::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.15 via Frontend Transport; Mon, 9 Mar 2020 19:30:07 +0000 From: Bernd Edlinger To: "Eric W. Biederman" 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" Subject: Re: [PATCH v2 3/5] exec: Move cleanup of posix timers on exec out of de_thread Thread-Topic: [PATCH v2 3/5] exec: Move cleanup of posix timers on exec out of de_thread Thread-Index: AQHV9ZIEZxv0OjAlrUW8EbkPvU5OCqhApyIA Date: Mon, 9 Mar 2020 19:30:13 +0000 Message-ID: References: <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> Accept-Language: en-US, en-GB, de-DE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR01CA0025.eurprd01.prod.exchangelabs.com (2603:10a6:208:69::38) To AM6PR03MB5170.eurprd03.prod.outlook.com (2603:10a6:20b:ca::23) x-incomingtopheadermarker: OriginalChecksum:1D11F3C52AA20EBC430DB346C09A4699A65F93F93FDB2F1ABAF13885F9D9B20A;UpperCasedChecksum:F65111DBCA5A0AC806A7EA7BA1E0E4446D647E0342302557EC34E3FF14B48D07;SizeAsReceived:9916;Count:50 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [OcD0NgGcG0JZG4F3xK7jxWsbdT9smler] x-microsoft-original-message-id: <49c40113-05fa-e31d-478a-d01915ed0059@hotmail.de> x-ms-publictraffictype: Email x-incomingheadercount: 50 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: d7a4e64a-a427-4c0e-b75b-08d7c4604967 x-ms-traffictypediagnostic: HE1EUR04HT222: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sNkwfI6O9nw/LbblTEqNANU0FcxXdbSkAk5YU+vMggTkwlweJGhwZuLThErFUiRkCtAyW+7xoxZAPX5JRxdR1b56GRqLIhB979M4xDYKdOEqJvBN7tCzaV9jVpEF0Z2laBH/nECodfbIvF69rmQJtsrnW3B3IovHZsAqIxayr9xQ/uen3I3y6Dc73o/rsdk5 x-ms-exchange-antispam-messagedata: vwHuoFtHtZ6FSlkk/P+IIWY5p10IbcCxjKqwOho3gWhDGBLd6Ucr1iC3EMUbdtgN2mhPOAmzdno8TicB5PfqWRF/DsPrOqoMf5zHy3rh/no/ppzQCjMfzjK5je2i2ca/SgVJSWHDHKOioh4pPaS2JQ== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="Windows-1252" Content-ID: <3386F6868CEAF14D9BF18D15F4701AD9@eurprd03.prod.outlook.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: d7a4e64a-a427-4c0e-b75b-08d7c4604967 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Mar 2020 19:30:13.2687 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR04HT222 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/8/20 10:36 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" Reviewed-by: Bernd Edlinger Bernd. > --- > 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. > */ >