From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DB2430AABF; Thu, 20 Nov 2025 23:50:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=166.70.13.231 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763682626; cv=none; b=D02xN/WYEam6mP975g2q2qujTP4eCXpnu25aqYbnjE7p9WYx1zMd5MQ7XL9FeB2VEQXEUTTzNNMyU07f4NPHy2rPzgmCUAhqSCVSIv+qiglemaTUaMSC3R4xvSj+ntjB32m7sn2+w9XJeXy35Pyq1GYXCGpU7xBkgT44+DmS4KM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763682626; c=relaxed/simple; bh=2k6nnKx4NCDkMoKdPHc9WTs3GWqy7H30K8kUmdQfeJk=; h=From:To:Cc:In-Reply-To:References:Date:Message-ID:MIME-Version: Content-Type:Subject; b=B7w4yw9hHATpIxw8rRLrDK9ZPQsPQ0uCyhApo5YXfYjVO7gmNP3SbpGlKyHdYxm6aerdmidzRqjZXjtFPnT8HTF4s7l4x/KJHtIgjqii07SMicJ6tTO/Cakqh1v1vpj3qZnT/34wpHmaFm7KNUfTBnZyCGs2tlmXPHTqKYLIBpc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xmission.com; spf=pass smtp.mailfrom=xmission.com; arc=none smtp.client-ip=166.70.13.231 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=xmission.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xmission.com Received: from in02.mta.xmission.com ([166.70.13.52]:37028) by out01.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1vMEPo-00CedT-A5; Thu, 20 Nov 2025 16:50:16 -0700 Received: from ip72-198-198-28.om.om.cox.net ([72.198.198.28]:35208 helo=email.froward.int.ebiederm.org.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1vMEPn-00C1ie-EW; Thu, 20 Nov 2025 16:50:15 -0700 From: "Eric W. Biederman" To: Bernd Edlinger Cc: Alexander Viro , Alexey Dobriyan , Oleg Nesterov , Kees Cook , Andy Lutomirski , Will Drewry , Christian Brauner , Andrew Morton , Michal Hocko , Serge Hallyn , James Morris , Randy Dunlap , Suren Baghdasaryan , Yafang Shao , Helge Deller , Adrian Reber , Thomas Gleixner , Jens Axboe , Alexei Starovoitov , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, tiozhang , Luis Chamberlain , "Paulo Alcantara (SUSE)" , Sergey Senozhatsky , Frederic Weisbecker , YueHaibing , Paul Moore , Aleksa Sarai , Stefan Roesch , Chao Yu , xu xin , Jeff Layton , Jan Kara , David Hildenbrand , Dave Chinner , Shuah Khan , Elena Reshetova , David Windsor , Mateusz Guzik , Ard Biesheuvel , "Joel Fernandes (Google)" , "Matthew Wilcox (Oracle)" , Hans Liljestrand , Penglei Jiang , Lorenzo Stoakes , Adrian Ratiu , Ingo Molnar , "Peter Zijlstra (Intel)" , Cyrill Gorcunov , Eric Dumazet In-Reply-To: <87h5uoxw06.fsf_-_@email.froward.int.ebiederm.org> (Eric W. Biederman's message of "Thu, 20 Nov 2025 14:57:29 -0600") References: <87tsyozqdu.fsf@email.froward.int.ebiederm.org> <87wm3ky5n9.fsf@email.froward.int.ebiederm.org> <87h5uoxw06.fsf_-_@email.froward.int.ebiederm.org> Date: Thu, 20 Nov 2025 17:50:05 -0600 Message-ID: <87a50gxo0i.fsf@email.froward.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1vMEPn-00C1ie-EW;;;mid=<87a50gxo0i.fsf@email.froward.int.ebiederm.org>;;;hst=in02.mta.xmission.com;;;ip=72.198.198.28;;;frm=ebiederm@xmission.com;;;spf=pass X-XM-AID: U2FsdGVkX195NfJOcpcY5dj59+cWhIBuzpRq6EZCwSg= X-Spam-Level: * X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.1 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * 0.7 XMSubLong Long Subject * 1.5 TR_Symld_Words too many words that have symbols inside * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa04 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa04 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Bernd Edlinger X-Spam-Relay-Country: X-Spam-Timing: total 339 ms - load_scoreonly_sql: 0.07 (0.0%), signal_user_changed: 10 (3.0%), b_tie_ro: 9 (2.6%), parse: 0.93 (0.3%), extract_message_metadata: 9 (2.7%), get_uri_detail_list: 0.70 (0.2%), tests_pri_-2000: 11 (3.2%), tests_pri_-1000: 9 (2.7%), tests_pri_-950: 1.06 (0.3%), tests_pri_-900: 0.97 (0.3%), tests_pri_-90: 79 (23.4%), check_bayes: 78 (23.0%), b_tokenize: 13 (3.8%), b_tok_get_all: 8 (2.4%), b_comp_prob: 2.1 (0.6%), b_tok_touch_all: 52 (15.4%), b_finish: 0.67 (0.2%), tests_pri_0: 207 (60.9%), check_dkim_signature: 0.53 (0.2%), check_dkim_adsp: 2.1 (0.6%), poll_dns_idle: 0.49 (0.1%), tests_pri_10: 1.92 (0.6%), tests_pri_500: 7 (2.0%), rewrite_mail: 0.00 (0.0%) Subject: Re: [RFC][PATCH] exec: Move cred computation under exec_update_lock X-SA-Exim-Connect-IP: 166.70.13.52 X-SA-Exim-Rcpt-To: too long (recipient list exceeded maximum allowed size of 512 bytes) X-SA-Exim-Mail-From: ebiederm@xmission.com X-SA-Exim-Scanned: No (on out01.mta.xmission.com); SAEximRunCond expanded to false "Eric W. Biederman" writes: > Instead of computing the new cred before we pass the point of no > return compute the new cred just before we use it. > > This allows the removal of fs_struct->in_exec and cred_guard_mutex. > > I am not certain why we wanted to compute the cred for the new > executable so early. Perhaps I missed something but I did not see any > common errors being signaled. So I don't think we loose anything by > computing the new cred later. I should add that the permission checks happen in open_exec, everything that follows credential wise is just about representing in struct cred the credentials the new executable will have. So I am really at a loss why we have had this complicated way of computing of computed the credentials all of these years full of time of check to time of use problems. Eric