Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4535079ybb; Tue, 7 Apr 2020 09:18:33 -0700 (PDT) X-Google-Smtp-Source: APiQypLW92Beh9cNhIngWEz9wLCAGuXRBwOrHuWYhiyHA6zUltuRQdEgQENxanv+ZDsiAUMoP6sc X-Received: by 2002:a9d:247:: with SMTP id 65mr2260653otb.364.1586276313751; Tue, 07 Apr 2020 09:18:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586276313; cv=none; d=google.com; s=arc-20160816; b=WUsFNo8ufRDZwFZiKvAJ9fXeebiy2t5x7wBfj2x9UNlwGfrHkuuRp51qS3ntcaW5Ks Qfb/uYfFgIf2bkG8+HIfmDKygluP+HVviDhsavbxXNo/9YXfUzHjwnLA7nsJ8MJ8izuA L+Jec4D2XK/r7bcc8E8B29a+kZuc95dJTURDtI1gjD5LxlNsv7lAARGafmlfdiZOUDhJ /jtrkP7gHPY6/b127iJukg3yM6ZcHAsk5mIK3d9POaUswHdSOjbzNqclipZrQ19xqChe FThwdhMXyB2rnLOJ4DLzbcffc+ZTfDaEckHkH/GHi/01BKnOo7FOIYX7qqsax1Wy7mNH bFOQ== 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; bh=fAotSBGvgANlGs1oMhYuQx7DILLS+d4djq/19hg2jwo=; b=LudJo+SISzDtPeCfEAEMsfiFCRM1V1VpCPvHbl9UdQJ2rpxJy4Ns2S0hi9G8SRVAFn HLYoPy4LgJSujqMNyIxkyNmzxj+CjAR0GLgGe2DgoRvKD3vAzsbef7wE3Ll1sqKR7z1f aK4naeMtjJXyobPUPHtC4lqh2k8B0GSVQCYMN03y6YkpcwwEs8j2f2p6tL6sacI8Ca5v N8plcXzpW93xYFlR+s9s7AHLXhzGoINq02e/nacIc8JYdMpxe7+aTj+f1fCSBoSFjsA/ CeXJGW0C4PJ1+mpynDJOS4CF8GZsYnUBfytdC65VPMIBAAxkY/3ZJ7RiSJ27Shu9K1wC Tccw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k20si1381879otb.168.2020.04.07.09.18.19; Tue, 07 Apr 2020 09:18:33 -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; 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 S1727376AbgDGQRK (ORCPT + 99 others); Tue, 7 Apr 2020 12:17:10 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:55885 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726877AbgDGQRK (ORCPT ); Tue, 7 Apr 2020 12:17:10 -0400 Received: from ip5f5bf7ec.dynamic.kabel-deutschland.de ([95.91.247.236] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jLquR-00072E-P5; Tue, 07 Apr 2020 16:17:07 +0000 Date: Tue, 7 Apr 2020 18:17:06 +0200 From: Christian Brauner To: "Eric W. Biederman" Cc: Linus Torvalds , Bernd Edlinger , Linux Kernel Mailing List , Alexey Gladkov , Oleg Nesterov , Kees Cook , Jann Horn Subject: Re: [PATCH 2/3] exec: Make unlocking exec_update_mutex explict Message-ID: <20200407161706.l5zfgghwr3p4vz2c@wittgenstein> References: <87blobnq02.fsf@x220.int.ebiederm.org> <87lfnda3w3.fsf@x220.int.ebiederm.org> <87wo6s3wxd.fsf_-_@x220.int.ebiederm.org> <87imic3wtz.fsf_-_@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87imic3wtz.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 Mon, Apr 06, 2020 at 08:31:52PM -0500, Eric W. Biederman wrote: > > With install_exec_creds updated to follow immediately after > setup_new_exec, the failure of unshare_sighand is the only > code path where exec_update_mutex is held but not explicitly > unlocked. > > Update that code path to explicitly unlock exec_update_mutex. > > Remove the unlocking of exec_update_mutex from free_bprm. > > Signed-off-by: "Eric W. Biederman" Yeah, assuming that I didn't miss any subtleties just now. By "explicit" I assume you mean not conditionally unlocked, i.e. we don't need to check any condition in free_binprm(). Acked-by: Christian Brauner