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.7 required=3.0 tests=FORGED_MUA_MOZILLA, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 D31FCC43331 for ; Sat, 28 Mar 2020 22:32:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 829C020732 for ; Sat, 28 Mar 2020 22:32:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 829C020732 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=hotmail.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1CE658E0001; Sat, 28 Mar 2020 18:32:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 17F636B0032; Sat, 28 Mar 2020 18:32:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06E6D8E0001; Sat, 28 Mar 2020 18:32:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0197.hostedemail.com [216.40.44.197]) by kanga.kvack.org (Postfix) with ESMTP id E0CE86B0010 for ; Sat, 28 Mar 2020 18:32:41 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E5F2F4DB7 for ; Sat, 28 Mar 2020 22:32:40 +0000 (UTC) X-FDA: 76646221680.01.hill84_6e97d9b5aec2a X-HE-Tag: hill84_6e97d9b5aec2a X-Filterd-Recvd-Size: 10244 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2050.outbound.protection.outlook.com [40.92.91.50]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Sat, 28 Mar 2020 22:32:39 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i6ZPzGrOgk5n0HE94J5P7Qf/JBAkPTVLkU/lQsJNoa67Pt9mHAxv4U8UerMkE2pQ97QFhh1w1fTd8xfYgINbYslUC8l1xxBzNp8xNZgXIS+p66VAF5kmXopQmbTDuQg2bM8HRE0XV6uFaLKldt0pYT8PjaQxBvn2yMRgf+k6DxNMaajTGz8k5II25THmY6CMq6QJtdmDp5bUMfgXuyKpAq3wFcy2FXjylJ8TNb4eYQHi4MukmyrkAQ2yNwGCkbmofj9sDFHIZLBlmie2NMnK7Pz7WEXHrUMbrgJiIe+nmMFhWZuXLKnSKD9udrQUIMogpuEaQ4kqEd6YH6Z1LFTJIw== 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=CHzRx0DZ4kZOpnuBwE/f6X/qED4fp9P8EPBb08k75Bk=; b=LSZ6wdfi/UmWPmCRWLnG0UpnaUn6lcb+rndkeToT8n996QR6TLrZfbhIpI5N4ZoVpsiurGjKx2pkSO+eV+Nl2wjBxW5HqSefxPl+Lf3xLBckOVfn8xa0JZoIhDAY3kJ3Zim796OM4QPhR05ILbuqY3Sl1wE4vxF0IWqAb0emh33NKvt9cScRstXKA7fT7ag6JDYjIWI2/R9vBx86hQRm7k3okXHozRiAmLq4WUZEXUn2m6dpgOY+BAuiDXG2yyoa3UQCtHh8b7q5KbcpEA4XB4qf2wHDeARBPrSHqbnXupRUWH4AztUcbHUIoaItvCKiTON6sTvqPw1KflP0QI7s1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hotmail.de; dmarc=pass action=none header.from=hotmail.de; dkim=pass header.d=hotmail.de; arc=none Received: from DB8EUR05FT029.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::52) by DB8EUR05HT204.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc0f::475) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.17; Sat, 28 Mar 2020 22:32:38 +0000 Received: from AM6PR03MB5170.eurprd03.prod.outlook.com (10.233.238.54) by DB8EUR05FT029.mail.protection.outlook.com (10.233.239.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.17 via Frontend Transport; Sat, 28 Mar 2020 22:32:38 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:07C77262F52CC5A0909879BEA80AE5195078149DF8382879DA587CD3D938E4C3;UpperCasedChecksum:629D2025165B1AF1E6127CB4CC865450842B380AAD5D08EEF0AB9C897C481B57;SizeAsReceived:9474;Count:50 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.2835.025; Sat, 28 Mar 2020 22:32:38 +0000 Subject: Re: [PATCH v6 00/16] Infrastructure to allow fixing exec deadlocks To: "Eric W. Biederman" Cc: Greg Kroah-Hartman , Kirill Tkhai , 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 , 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: <871rpg8o7v.fsf@x220.int.ebiederm.org> From: Bernd Edlinger Message-ID: Date: Sat, 28 Mar 2020 23:32:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 In-Reply-To: <871rpg8o7v.fsf@x220.int.ebiederm.org> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: ZRAP278CA0009.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::19) To AM6PR03MB5170.eurprd03.prod.outlook.com (2603:10a6:20b:ca::23) X-Microsoft-Original-Message-ID: <3b999eea-781e-ea54-3cad-1e3d31704e35@hotmail.de> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.101] (92.77.140.102) by ZRAP278CA0009.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.19 via Frontend Transport; Sat, 28 Mar 2020 22:32:36 +0000 X-Microsoft-Original-Message-ID: <3b999eea-781e-ea54-3cad-1e3d31704e35@hotmail.de> X-TMN: [Wb+RayWrRxNa9tP0qc+L6Ys6ZZ4B7nLV] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: aa64989f-b15f-4b08-4772-08d7d367eb51 X-MS-TrafficTypeDiagnostic: DB8EUR05HT204: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qLc/zbJBOpOw9Xagz3/d8ZqTii00cEZk7SpuJ4KXTnWqwBVu23pTGKb+0xxGR0FmfYDk88t1kzZayd4WTG0AMu+LLTJ+W9IzWbNQQyJZYHKSjk17+ot18jq6ORxanEUbzTxOmMnTbv4momX21JsIklM3kKcowBcSU37+zlLkbiuj62rTUMxGHpQwdSTvRPFRBbMKB9E88rVQ0nzOzA1kIH9aBIMROgk5joTRZWvXFWs= X-MS-Exchange-AntiSpam-MessageData: F/awmNM0cKPdFfpmZ6zrODiCLG4bMc50yzrue4hvpAlrErlVRpMUAwgVVT9ZdqjpRqUbnZr++ETxSfW/4BMotH+pZsUVUwhYoZkPXTOrLnSb3yFYc55UqWpLJomT0crY8sdlQYovrsh9DHn3UT9ViQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa64989f-b15f-4b08-4772-08d7d367eb51 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2020 22:32:38.4596 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8EUR05HT204 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 3/25/20 4:10 PM, Eric W. Biederman wrote: > Bernd Edlinger writes: > >> This is an infrastructure change that makes way for fixing this issue. >> Each patch was already posted previously so this is just a cleanup of >> the original mailing list thread(s) which got out of control by now. >> >> Everything started here: >> https://lore.kernel.org/lkml/AM6PR03MB5170B06F3A2B75EFB98D071AE4E60@AM6PR03MB5170.eurprd03.prod.outlook.com/ >> >> I added reviewed-by tags from the mailing list threads, except when >> withdrawn. >> >> It took a lot longer than expected to collect everything from the >> mailinglist threads, since several commit messages have been infected >> with typos, and they got fixed without a new patch version. >> >> - Correct the point of no return. >> - Add two new mutexes to replace cred_guard_mutex. >> - Fix each use of cred_guard_mutex. >> - Update documentation. >> - Add a test case. >> >> Bernd Edlinger (11): >> exec: Fix a deadlock in strace >> selftests/ptrace: add test cases for dead-locks >> mm: docs: Fix a comment in process_vm_rw_core >> kernel: doc: remove outdated comment cred.c >> kernel/kcmp.c: Use new infrastructure to fix deadlocks in execve >> proc: Use new infrastructure to fix deadlocks in execve >> proc: io_accounting: Use new infrastructure to fix deadlocks in execve >> perf: Use new infrastructure to fix deadlocks in execve >> pidfd: Use new infrastructure to fix deadlocks in execve >> exec: Fix dead-lock in de_thread with ptrace_attach >> doc: Update documentation of ->exec_*_mutex >> >> Eric W. Biederman (5): >> exec: Only compute current once in flush_old_exec >> exec: Factor unshare_sighand out of de_thread and call it separately >> exec: Move cleanup of posix timers on exec out of de_thread >> exec: Move exec_mmap right after de_thread in flush_old_exec >> exec: Add exec_update_mutex to replace cred_guard_mutex >> >> Documentation/security/credentials.rst | 29 +++++-- >> fs/exec.c | 122 ++++++++++++++++++++++-------- >> fs/proc/base.c | 23 +++--- >> include/linux/binfmts.h | 8 +- >> include/linux/sched/signal.h | 17 ++++- >> init/init_task.c | 3 +- >> kernel/cred.c | 4 +- >> kernel/events/core.c | 12 +-- >> kernel/fork.c | 7 +- >> kernel/kcmp.c | 8 +- >> kernel/pid.c | 4 +- >> kernel/ptrace.c | 20 ++++- >> kernel/seccomp.c | 15 ++-- >> mm/process_vm_access.c | 2 +- >> tools/testing/selftests/ptrace/Makefile | 4 +- >> tools/testing/selftests/ptrace/vmaccess.c | 86 +++++++++++++++++++++ >> 16 files changed, 278 insertions(+), 86 deletions(-) >> create mode 100644 tools/testing/selftests/ptrace/vmaccess.c > > Two small nits. > > - You reposted my patches with adding your signed-off-by > - You reposted my patches and did not include a "From:" > in the body so "git am" listed you as the author. Oh, do I understand you right, that I can add a From: in the *body* of the mail, and then the From: in the MIME header part which I cannot change is ignored, so I can make you the author? Thanks Bernd. > > I have fixed those up and will be merging this code to linux-next, > unless you object. > > Eric >