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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 B63C9C433FE for ; Mon, 7 Dec 2020 09:16:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83C9523437 for ; Mon, 7 Dec 2020 09:16:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726569AbgLGJP6 (ORCPT ); Mon, 7 Dec 2020 04:15:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726016AbgLGJP6 (ORCPT ); Mon, 7 Dec 2020 04:15:58 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DA7AC0613D0 for ; Mon, 7 Dec 2020 01:15:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=yAvxPEKZaf6fFMzPaov349GhYP2S2lyW0J3rC9KuTzw=; b=p8P9peR3P/ByWb4PdlmrECAe0A ic/mYpm7h1EF189FYv7hFKAxf8W/PlhLuFigscheGnRDnWYOSxbMnlD8fY4r7J+BVt0Oi3rR61IU/ PiECNtRlJfvowEn6NrsuTYpiWVAzYzZ6Jvkv0ShFZlSQjEnkAuKGMk91y4A0JnVla7mA4kOVfvAAh mUMVuB6D+HaFoHO+Ky4pQwb9H7D6bd+hZ2uwZlFzXUlkLyNKx99CJzFINegk8SmJwpPM5NuCzZQG6 P63J35qh/g/787wzjwnS8+WFpjIROcyfHUG+7O0pPExHlgkFbZE2zFMOvtILMM0NtCWgfvqhI5p0h PyU8nYWA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmCbn-000635-Sr; Mon, 07 Dec 2020 09:15:04 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 25AD43006D0; Mon, 7 Dec 2020 10:15:03 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 0E52C200E0BA7; Mon, 7 Dec 2020 10:15:03 +0100 (CET) Date: Mon, 7 Dec 2020 10:15:02 +0100 From: Peter Zijlstra To: "Eric W. Biederman" Cc: Davidlohr Bueso , Linus Torvalds , Bernd Edlinger , Linux Kernel Mailing List , Ingo Molnar , Will Deacon , Jann Horn , Vasiliy Kulikov , Al Viro , Oleg Nesterov , Cyrill Gorcunov , Sargun Dhillon , Christian Brauner , Arnd Bergmann , Arnaldo Carvalho de Melo , Waiman Long Subject: Re: [PATCH 3/3] exec: Transform exec_update_mutex into a rw_semaphore Message-ID: <20201207091502.GG3040@hirez.programming.kicks-ass.net> References: <87tut2bqik.fsf@x220.int.ebiederm.org> <87ft4mbqen.fsf@x220.int.ebiederm.org> <875z5h4b7a.fsf@x220.int.ebiederm.org> <20201204214836.3rncqw5kox42b4i2@linux-p48b.lan> <878sacyvpv.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878sacyvpv.fsf@x220.int.ebiederm.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 05, 2020 at 12:05:32PM -0600, Eric W. Biederman wrote: > I am trying to understand why the permission check is there. It's about observability, is task A allowed to observe state of task B? By installing a perf event on another task, we can very accurately tell what it's doing, and isn't fundamentally different from attaching a debugger (ie. ptrace). Therefore we chose to use the same security checks. As is good custom, one does security checks early. Then Jann came and observed that race against execve mucking with privs, and we got to hold that mutex across lots. That patch I proposed earlier should solve that all.