Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp838023ybh; Wed, 11 Mar 2020 11:51:13 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtPlpQNTwojl9gBGNi75f6YJtmOwv3/6dtVcfOYTZtHkqYHmbjefYyhQSn9jOyM7y+lArh6 X-Received: by 2002:a05:6830:10da:: with SMTP id z26mr3244521oto.27.1583952673191; Wed, 11 Mar 2020 11:51:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583952673; cv=none; d=google.com; s=arc-20160816; b=K19xARE2BqxfVt9jn2q8S9IDqiMefTclhXE30VdTitpByXKItLmM2Wqlf/pmnv7e6O OE+l80wowH6zAEiIplvAApitv3+amgkhyRMoALZX3Hu6pnjrvAnilMbVi1lgOoEaQ9Tb d7FO9EsZONDU4ozMq1Pk3CZXt4MNjVT1uISQ3bj6wd+zwD0MSIdf1u6kn0smxImgkhc8 NRA3xV/1qprHXyDwe1RoIb4bxGW4+0r5KQpyz84qVib2UykzmVT5iwhBxyorkbG5JXVs 4yjKT3Gy61TqcW3MTn9Ua3KiCFmy03oAlygxgvlP5KJVqfFcZ8StzQSM5QVuvoNqCSVW nRsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=1O5mNwRKS3WQZf3p7S3pD40Ezb3WQVwbR9o3MD95weI=; b=wEI/bZKv0MONswwH2bHpSn2DY4nyN9zYUMHnScJ2oNDssPaRfpDwbRbVMyMT2zEyC7 Lc15pJx9aO6eXyKInUFBa+HK9zGfc1IL0kFApLEGXkgeFGLSJBb1gJ7MvtteXTee3OiG 3BUdPWdsl4gAoyiG0t1kPTzHil1Ko4RgCKoQNWGqrhkRAQhxZnTs1NJ4uazP3KtgPiBj c3F1tsBgiS/h7gE2ZDNLielroWTDk1//x/+Aw1Ce1fTsS63glHE/UaCMKFRarJIxIMf0 flmarACLARdXktUF8ghlDSXyBgqhbjRL7kQGS+pVNQvotckcUl7aYXwUAc24br0j+pgD 9vNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=m+VDswWk; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s15si1379747oie.175.2020.03.11.11.51.00; Wed, 11 Mar 2020 11:51:13 -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=@chromium.org header.s=google header.b=m+VDswWk; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730960AbgCKSt6 (ORCPT + 99 others); Wed, 11 Mar 2020 14:49:58 -0400 Received: from mail-pj1-f65.google.com ([209.85.216.65]:35081 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730951AbgCKSt5 (ORCPT ); Wed, 11 Mar 2020 14:49:57 -0400 Received: by mail-pj1-f65.google.com with SMTP id mq3so1458296pjb.0 for ; Wed, 11 Mar 2020 11:49:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=1O5mNwRKS3WQZf3p7S3pD40Ezb3WQVwbR9o3MD95weI=; b=m+VDswWkn7oQWzwAESTvbUWn0hrwmnnEnt9dMsZtQKuIuHrc/4r8XX+lx3mOiCCcLf wm8Cz5DjMVhJvDP2VVG0zJ6SHpUILyY5dzan67JIz+4vG+F5i9SL1nVUXx4dramPRkPf S6tllCNLWc9gmhewcz7zNJik0de/BY4hu9fI8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=1O5mNwRKS3WQZf3p7S3pD40Ezb3WQVwbR9o3MD95weI=; b=PGqHQ497Bbh595qFYBOUgSf+l39IkrYF3SLV8FW89icC3/1wymqbqhGDF0tP5LihAq 4RIyIStoNa82HAW4IJMV9dbE3YquAQpPnwJdlZe3RnphDKAo53o+H/pxcRtnNxS15ZJC C4UGLnns30DiFUKmUW4MePfKbVMABTClcsJz8fEKw58gahf/E4oHfElcFj6pA2nlCjHS wY33U14rIo5o2/nyGjcD+znZLXjGIRVpmwc/lTz9ZjIXdwAivbSJfmLbrKF40fJcxnvu NizCP8/ijk1VMlpQ9CMn0zoHn8xPcjzmIZoj3ONjXTs5Gp0Otn4ZY3eX7ObxtpDJStIW vHSw== X-Gm-Message-State: ANhLgQ23uFHoikHT9CIb/gQZpf54mGmk2mqby4TFFtwhQeiz0+Pi4YgU iM+2aZfisYEkwj2b2S4/xuDzEQ== X-Received: by 2002:a17:90a:d80b:: with SMTP id a11mr131940pjv.21.1583952596740; Wed, 11 Mar 2020 11:49:56 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 13sm49989285pgo.13.2020.03.11.11.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 11:49:55 -0700 (PDT) Date: Wed, 11 Mar 2020 11:49:54 -0700 From: Kees Cook To: "Eric W. Biederman" Cc: Jann Horn , Christian Brauner , Bernd Edlinger , 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" , Arnd Bergmann , Sargun Dhillon Subject: Re: [PATCH] pidfd: Stop taking cred_guard_mutex Message-ID: <202003111148.19578AA@keescook> References: <877dztz415.fsf@x220.int.ebiederm.org> <20200309201729.yk5sd26v4bz4gtou@wittgenstein> <87k13txnig.fsf@x220.int.ebiederm.org> <20200310085540.pztaty2mj62xt2nm@wittgenstein> <87wo7svy96.fsf_-_@x220.int.ebiederm.org> <87k13sui1p.fsf@x220.int.ebiederm.org> <87lfo8rkqo.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87lfo8rkqo.fsf@x220.int.ebiederm.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 10, 2020 at 03:57:35PM -0500, Eric W. Biederman wrote: > So ptrace_attach and seccomp use the cred_guard_mutex to guarantee > a deadlock. Well, that's the result, but seccomp uses it because it wants to be certain that credentials and no_new_privs are changed together "atomically". -- Kees Cook