Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp602302ybk; Sat, 9 May 2020 12:20:32 -0700 (PDT) X-Google-Smtp-Source: APiQypKng7vvSVhcOB7ByZpplK/f4Lv/dHKTDOYdsFagQTZEPH39cjRqDxPyIbOsDIL5W3ufz9zE X-Received: by 2002:a05:6402:c87:: with SMTP id cm7mr4595998edb.285.1589052032668; Sat, 09 May 2020 12:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589052032; cv=none; d=google.com; s=arc-20160816; b=TPXKIGWCldXetBhCF3ug+o2GamHIu+SDH4TMXU5tZsL8neT7bAy3r9RadyU319s5fn 6g0DBTcBQSfXSZjJIzL/847t5kslDJkA02LVhcaTphOIdws3s0caa/1yjcTE5E1x4P36 YJ8gC56jWKM8l1PO3efB1A6p9RcUS/vQIhlIAMqDzcv++Hh2EFBF/SmWbz6XQvAP7fN2 Yjb7stwLm5nwTd2Gxy3xwLMRjMIk2pCCw50uAshCWmdgyCC6f4Y9PA+EkL50jOCfq/GK aCXrCgL0tuCIKT0DzOAI8CmYhdcF9/3/TWDcUteN/Mq9LXWs2k/OdBFhKhVWk4i/YRpa 6C/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=MTaQjuSq7+Uk0mjz5XhiS0By4Z0ZIBHeP5OQxoY0AXY=; b=t4cFFwgb1O+r5E41A+V+gHfi5T6R0mcpMcMtGVX/hH+2ZxQ555uN8sv86C6VLMwdHQ UaW45PRwdIYmLZjiPlWFMCAA3nWhIm1TPVpqMDe7zcVgI0oaBfVO0Dk2bQ55fgaXeavz JIGo1Bk0Ocl4UUKmyOGniwuAPGeEU9iBObSFnFr18v44juk/t1Fq0WBkNOkOF70F3BtE FPPpK746Hf8SVYa3oqr4Du0l4oZc+Jcc8PV9BO3dmyeL8LFdYS/0b3VNnjc7y9mRF6Q3 pHDFtvhn0Vm5spoc/ijeJef/WeHxMjbqT4em/HwrcovWbzoUHe6Tch98QC4goPpl2mZw 74kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="bb8lv33/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k2si2471038ejv.324.2020.05.09.12.20.09; Sat, 09 May 2020 12:20:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="bb8lv33/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728359AbgEITS3 (ORCPT + 99 others); Sat, 9 May 2020 15:18:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727938AbgEITS2 (ORCPT ); Sat, 9 May 2020 15:18:28 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87B8CC061A0C for ; Sat, 9 May 2020 12:18:28 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id j3so5188553ljg.8 for ; Sat, 09 May 2020 12:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MTaQjuSq7+Uk0mjz5XhiS0By4Z0ZIBHeP5OQxoY0AXY=; b=bb8lv33/xdxQCjzNvqgBwiUcCYj652YvhdbqcvSHcY1rj9neVWryv4l1j6MmeGq4jo AEH6Z8NxA7GKp1r/srByCIJnplyXBSDQ62DfynP6rinchtYP4IYYLHytr7y6o8ZD6J1K ZVP3pi5JLSulmR+djlIuZSg8uAVtxAHd0IwZs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MTaQjuSq7+Uk0mjz5XhiS0By4Z0ZIBHeP5OQxoY0AXY=; b=RK2JwdIny9thhrOENM6DucFDF08JHpENIF7LxtJr7N3E0FIyN8zElG82AcjkUkOWbr AUi3UWGJ3NwQp562F4xHegi4OkO0gHKIjGhST+RV641bN31je2iatsgpacwlbiQoQRqU QIWlTSicz4oaXSejXMqbxjiD0bSgaRFw3OWO1eEMNPULdlFCiK4SZXbEjs8+yLuqCAzQ WCoYfsOKTAqaZ7ohQaLkez2xRrVzYWuI5p2E31sUncUibIH/Tk/tdtsO7qdFFiuGg/e/ akm+dH+s6lxiKu3/VGTFZ+gE9CoQPy33JW8J8nYEknXSgz2akOOh7j8V2lxmNxikuetA nZCQ== X-Gm-Message-State: AOAM532pNd2yo1tkEi2GbYrr5w06T8mLzPLmbQjKXn2SbnmRG6bGGfZB N93doKj8WGSeI15cHQidd+VzzautNpc= X-Received: by 2002:a2e:8018:: with SMTP id j24mr5568784ljg.246.1589051905347; Sat, 09 May 2020 12:18:25 -0700 (PDT) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com. [209.85.167.51]) by smtp.gmail.com with ESMTPSA id m132sm4894291lfa.94.2020.05.09.12.18.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 May 2020 12:18:23 -0700 (PDT) Received: by mail-lf1-f51.google.com with SMTP id a4so4098331lfh.12 for ; Sat, 09 May 2020 12:18:23 -0700 (PDT) X-Received: by 2002:ac2:418b:: with SMTP id z11mr5854254lfh.30.1589051902927; Sat, 09 May 2020 12:18:22 -0700 (PDT) MIME-Version: 1.0 References: <87h7wujhmz.fsf@x220.int.ebiederm.org> <87sgga6ze4.fsf@x220.int.ebiederm.org> <87blmy6zay.fsf_-_@x220.int.ebiederm.org> In-Reply-To: <87blmy6zay.fsf_-_@x220.int.ebiederm.org> From: Linus Torvalds Date: Sat, 9 May 2020 12:18:06 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/6] exec: Stop open coding mutex_lock_killable of cred_guard_mutex To: "Eric W. Biederman" Cc: Linux Kernel Mailing List , Oleg Nesterov , Jann Horn , Kees Cook , Greg Ungerer , Rob Landley , Bernd Edlinger , linux-fsdevel , Al Viro , Alexey Dobriyan , Andrew Morton Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 8, 2020 at 11:48 AM Eric W. Biederman wrote: > > > Oleg modified the code that did > "mutex_lock_interruptible(¤t->cred_guard_mutex)" to return > -ERESTARTNOINTR instead of -EINTR, so that userspace will never see a > failure to grab the mutex. > > Slightly earlier Liam R. Howlett defined mutex_lock_killable for > exactly the same situation but it does it a little more cleanly. What what what? None of this makes sense. Your commit message is completely wrong, and the patch is utter shite. mutex_lock_interruptible() and mutex_lock_killable() are completely different operations, and the difference has absolutely nothing to do with -ERESTARTNOINTR or -EINTR. mutex_lock_interruptible() is interrupted by any signal. mutex_lock_killable() is - surprise surprise - only interrupted by SIGKILL (in theory any fatal signal, but we never actually implemented that logic, so it's only interruptible by the known-to-always-be-fatal SIGKILL). > Switch the code to mutex_lock_killable so that it is clearer what the > code is doing. This nonsensical patch makes me worry about all your other patches. The explanation is wrong, the patch is wrong, and it changes things to be fundamentally broken. Before this, ^C would break out of a blocked execve()/ptrace() situation. After this patch, you need special tools to do so. This patch is completely wrong. And Kees, what the heck is that "Reviewed-by" for? Worthless review too. Linus