Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp772244imu; Thu, 13 Dec 2018 04:19:25 -0800 (PST) X-Google-Smtp-Source: AFSGD/WbTMXVq6JVe/C3pYHjTF68d4h7XqR9Oex0O0QPW7gmgEU5A20beYfeeAS6DCu5LvVuUQcX X-Received: by 2002:a62:31c1:: with SMTP id x184mr24675848pfx.204.1544703565061; Thu, 13 Dec 2018 04:19:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544703565; cv=none; d=google.com; s=arc-20160816; b=x5NC3BMa/TTc7WZsVzhGnyZv36gyp9jXc4fe4S7eVQ+GB+8w4+6cJzwOlv9rptk25i Tg3ynrbJ5x1ZnjK9BX4WBRR5jq86Pzh1fKSa6M5F58xAmCP4pdG9saVU69hIEWyiROSJ 0lSyWdPvkGSt60jUyfh/RsOamVyJQg9Nl2Pl2+QOqfkcj0/9YovAZva4sCn0lVekK5sM Kvw4B8EwvJTWfemOJXfjtvKOdKUkVeS/ZkKb11SYYiQ0QFoD0YPCY9GSfGVOzCKhO8a8 3CZI6uSUVzjW3bb6OSKyZ41JgWOsnngcVUhXelZUof+YbuNPs5zOE6BsE12hEKBEQemk svaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4ZXtW55JAa/vg3hQkSbYV2kNZlrL5oduqPKvGV7TOe0=; b=fNuUyp54CUxq8nZgNiljfespnKLFJ0lc9ULBlRmaIhFqnwU6o2eDjaMkbAXOaWrwee 1r3xYE4bnHxNn0pc5bFx84TK9taRjK/1rPUYPMCZJUpCEYlJI8kr3Eox+F8sQR9eLwk0 4SeA9oBhT8ZFMHFK9JXipoRBY0aKzybOXwNsYUJngeAikznQb6z+nX6uB0THm0fTqBrc VDppz/eOyowLeTAz8I+AazzsBc56PYiPyzd/6yo4g3Zz4nhxNP+BIyeOObv4FondhXZ3 YaB+FRaegoVp1H4J96bgK7T85ZOEEfWoQ4zPOKMEp2LELRC5WkohFU55YHW96FjC87Mt dyRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=U0v7yaA5; 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 c22si1412027pgb.254.2018.12.13.04.19.10; Thu, 13 Dec 2018 04:19:25 -0800 (PST) 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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=U0v7yaA5; 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 S1728926AbeLMMQu (ORCPT + 99 others); Thu, 13 Dec 2018 07:16:50 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:47792 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728806AbeLMMQu (ORCPT ); Thu, 13 Dec 2018 07:16:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4ZXtW55JAa/vg3hQkSbYV2kNZlrL5oduqPKvGV7TOe0=; b=U0v7yaA5V9wVYtvPRItgV/9ZUY US6ZjDY/ysvQOu15Y3/azoIN4C0QCObr9ZWszHqkM1ZcF0aOW7+FA/q2SjXv4Khz3tmknei2qrrSH tAltIO3mgfQeLH5UD+52ZXFMHgTQNVz24x90l7Nb+WLyjkuO+4ZY5VArrMOtvpSR2ZnPkv+Bw3Q2M 5cOyOg3CvX3E1Gn12ctQm63+qeCJ9jPQOSGIMpGMdUlXm/SPfBYaJUXmWOOixVN1o6eg0AZ5KUtf2 IbL4KjwryqD9vigGzf8sRYhwVqNtJdoN3oGcizaG76TwznbWNSyenbBGXowAUSJkX4FKXXTuO6qqt PeYnujiw==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gXPv4-0002z1-75; Thu, 13 Dec 2018 12:16:46 +0000 Date: Thu, 13 Dec 2018 04:16:46 -0800 From: Matthew Wilcox To: Mimi Zohar Cc: =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , linux-kernel@vger.kernel.org, Al Viro , James Morris , Jonathan Corbet , Kees Cook , Matthew Garrett , Michael Kerrisk , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Philippe =?iso-8859-1?Q?Tr=E9buchet?= , Shuah Khan , Thibaut Sautereau , Vincent Strubel , Yves-Alexis Perez , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [RFC PATCH v1 0/5] Add support for O_MAYEXEC Message-ID: <20181213121645.GN6830@bombadil.infradead.org> References: <20181212081712.32347-1-mic@digikod.net> <20181213030228.GM6830@bombadil.infradead.org> <1544699060.6703.11.camel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1544699060.6703.11.camel@linux.ibm.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 13, 2018 at 06:04:20AM -0500, Mimi Zohar wrote: > > I don't have a problem with the concept, but we're running low on O_ bits. > > Does this have to be done before the process gets a file descriptor, > > or could we have a new syscall? Since we're going to be changing the > > interpreters anyway, it doesn't seem like too much of an imposition to > > ask them to use: > > > > int verify_for_exec(int fd) > > > > instead of adding an O_MAYEXEC. > > The indication needs to be set during file open, before the open > returns to the caller. ?This is the point where ima_file_check() > verifies the file's signature. ?On failure, access to the file is > denied. I understand that's what happens today, but do we need to do it that way? There's no harm in the interpreter having an fd to a file if it knows not to execute it. This is different from a program opening a file and having the LSM deny access to it because it violates the security model.