Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1431741ybk; Thu, 14 May 2020 08:51:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcmcGTDYnTVXNG7k0bi5NjBzh+HyFCPaMD7dmqBCVViNob1ENVDvvWSmrL12dy8svor3YA X-Received: by 2002:a17:906:5615:: with SMTP id f21mr2814801ejq.372.1589471482491; Thu, 14 May 2020 08:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589471482; cv=none; d=google.com; s=arc-20160816; b=Ypz/s65CRkc8Fl33PQCcTDmrbvdYZ2D3XjbYTG6ttijgtE/E5bSKNlIvCMpqRkY19L NoHTmjHYBbJKrw/XVFTvI148PLhI4p3bABuu5Xu8Yxh849EPxG6WXCEqErJyyMj6Kpg6 O7OXyzQ8ik2rilp86LvDZt0wTC84oC3yrM9+raQNpGdFGARVzrTuV1MuZoNu3OKMWNga vlQocHLflmTHvjC1IDPJPVQuEk+EHCyoAPvKXm1LzT8TkSHdJqrKd10n2mV1PEKpAzwg AsPFio3r/MwgmMkDruGireY/PDYsrkyoVPWFLBzRmb0+ZK2e1DnxM3OF1lkDTd1dY1/y fLAw== 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=xc0xMz/yvwFH4+2sZUX9Mzn97it6v0pR0LQRUSS/E70=; b=qXRvdgTBzo+nIlv+DHpg1V88b0ttpFTsePtAHAwgz0rLojo9BKAO5U9LawcL7RnEuC whMe/N6o/fN/KipX5gp8LfxiaeAUmhCpa/hQyt5d57D/s2ezor+lte9Oa0gAhWYO1NwU OXom3Wijo4FJ8VHML/bAX4yNMxUZqTfDkCff8LuYt/xVQ7xPoI6kNEM3TOx0ZnGXPW+5 DYuo4JEtKQwDnwvLHQpQqp43kGH/azppJmORGAPiybYM+S5YGAlCFuBHXffdW7RkOHOz O/hDM35QNUL9GxoLL2W68g8bm35F69lJ5UPoZ8D4vHUMH4iTLSJi5BnI398DCTGYFAKY cq6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PiA5t1EC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x61si2033416ede.23.2020.05.14.08.50.59; Thu, 14 May 2020 08:51:22 -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=@chromium.org header.s=google header.b=PiA5t1EC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727956AbgENPtA (ORCPT + 99 others); Thu, 14 May 2020 11:49:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726582AbgENPs7 (ORCPT ); Thu, 14 May 2020 11:48:59 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99DBEC061A0F for ; Thu, 14 May 2020 08:48:59 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id n15so1190173pjt.4 for ; Thu, 14 May 2020 08:48:59 -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=xc0xMz/yvwFH4+2sZUX9Mzn97it6v0pR0LQRUSS/E70=; b=PiA5t1ECMRuuR+HXKMfA3cTte/yc0Jb2wZpjTuONoyQT8+eOxJ6lAv6xWFVheYAPQX mop7QRaUoUv6SEjqXRjbU5K99Kz3EUrsQLuoTiltzApmHSCKH5G+nrxw8ti9nhdb7fqe jWfLI5KiJD47MHevRL9KAaQDdLmDrDUpw7Tiw= 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=xc0xMz/yvwFH4+2sZUX9Mzn97it6v0pR0LQRUSS/E70=; b=h0O7+PQLxXrb/pDhRU9zeBUPYuFX8yHrooOUF932gfowJFvWZm9X+SG87TbfW2n827 XdBkvhOAWh2scm9AR5IgYBf9bKY+s0UjaQBsgwR3NuZ+RhmeprQtisVj524Swrv6XztI rIaTaEoCw/AYufnR/DK70HWPdsP6YXMtQTXN2/kh89wLsvviY5kThFV2/4LFX/tC9Rq2 NZ/7zcsDLSjhdUKk4FfBMkAS+iv4SDcsCS66TGp3Wa8feNWvv0dWoDC4EL6lw9NXf1W9 wqd+N13eneh0pOMuEON6EvqtO2MpaFwQt4meg/c7H/btTGDXUZX9wTR5h3aPqDtuLV1w OWOg== X-Gm-Message-State: AGi0PuZHAkYUReXEY1OoxZ21+Cz1Mri5ngsTbJslFxqoEl2tJmMatX1/ 2rv7HpbrNkiPIq/SyUfSKbming== X-Received: by 2002:a17:90a:f995:: with SMTP id cq21mr39335143pjb.56.1589471339202; Thu, 14 May 2020 08:48:59 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id cx11sm2467105pjb.36.2020.05.14.08.48.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 May 2020 08:48:58 -0700 (PDT) Date: Thu, 14 May 2020 08:48:57 -0700 From: Kees Cook To: "Lev R. Oshvang ." Cc: =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , linux-kernel@vger.kernel.org, Aleksa Sarai , Alexei Starovoitov , Al Viro , Andy Lutomirski , Christian Heimes , Daniel Borkmann , Deven Bowers , Eric Chiang , Florian Weimer , James Morris , Jan Kara , Jann Horn , Jonathan Corbet , Lakshmi Ramasubramanian , Matthew Garrett , Matthew Wilcox , Michael Kerrisk , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Mimi Zohar , Philippe =?iso-8859-1?Q?Tr=E9buchet?= , Scott Shell , Sean Christopherson , Shuah Khan , Steve Dower , Steve Grubb , Thibaut Sautereau , Vincent Strubel , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-integrity@vger.kernel.org, LSM List , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v5 2/6] fs: Add a MAY_EXECMOUNT flag to infer the noexec mount property Message-ID: <202005140845.16F1CDC@keescook> References: <20200505153156.925111-1-mic@digikod.net> <20200505153156.925111-3-mic@digikod.net> <202005121407.A339D31A@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 14, 2020 at 11:14:04AM +0300, Lev R. Oshvang . wrote: > New sysctl is indeed required to allow userspace that places scripts > or libs under noexec mounts. But since this is a not-uncommon environment, we must have the sysctl otherwise this change would break those systems. > fs.mnt_noexec_strict =0 (allow, e) , 1 (deny any file with --x > permission), 2 (deny when O_MAYEXEC absent), for any file with ---x > permissions) I don't think we want another mount option -- this is already fully expressed with noexec and the system-wide sysctl. -- Kees Cook