Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp705499imu; Thu, 13 Dec 2018 03:06:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/XYk6ZGyuTzLQ22NJ+Vtd9qrSsmrHpN6Ehfs+7sarHeUQzlW6I/i5U/7NlL0cD2de6EmsC7 X-Received: by 2002:a17:902:1122:: with SMTP id d31mr9668967pla.246.1544699176886; Thu, 13 Dec 2018 03:06:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544699176; cv=none; d=google.com; s=arc-20160816; b=ltpu8zI/c9kXvjjF3XpVXA+yzvKdsVA+48/wuWeGT10Tyb5NpPAjGatINoXWonnBOS HWf+Eh1p1jTUHYh+FK2+hBmGLsE4kLVEjZLP53v7VcL16apaMoo3c/ILCm9wlHDl6nwM glbNwNhf1/wQv0wQA0kyzCKwgtao4VZXV15RDql1cXE4OSdad/2RaE8aOj7dyG+HJs5r QnpugHD5738VaKesYgMDvifYEuimQJ8wPqg66d2U41bC4hbCHX6i99qROEad+qudpX9s mCi4qlnjHO5VBuiFgjomNbPha1Pt/zjYCbZ+b1U5mz/us0i4sz2z9nrHI7GWQYyu8hw2 Hjww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:cc:to:from:subject; bh=OrDTi8AIt2dWyGobcFuxMd3Tzxi87os4q6fVSlHPJGE=; b=LQK8C12EGZpHVqP5YCX3sYCSvTeWl7FwuJsluVoLyBkUqMsBKbM0/CggxZqoDTtva4 Qkm6x7aYbPRkdxh87Snt5RsP0UmDNQHSRLtwfAAKWvFpDX+NOXQ93kZUW4/CjurXustb A2Um5FUXziMh+zxsRlSXrHY0aSXFZ9qHGhEnHf622+hF4aVcjdn6J2TSRxuVyx5aMc04 xbJkajlpfC13g3Iz5UFi90cH1rtZW1VGHXvdN9lIGl6WjCO/YM35ILQIiGcFSPJHWu7l oMQECPu5mYV4kcYZT0/aIzRcZdK4QIRiWPR0Crg99V4kwO/oQX87H1ywib6Gut+Qo+NM P0Qw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a11si1334512pga.198.2018.12.13.03.06.00; Thu, 13 Dec 2018 03:06:16 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728650AbeLMLEq (ORCPT + 99 others); Thu, 13 Dec 2018 06:04:46 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48568 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728590AbeLMLEo (ORCPT ); Thu, 13 Dec 2018 06:04:44 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wBDB4I5T094358 for ; Thu, 13 Dec 2018 06:04:43 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2pbnkfhxug-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 13 Dec 2018 06:04:43 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 13 Dec 2018 11:04:40 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 13 Dec 2018 11:04:34 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wBDB4XSJ9109794 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 13 Dec 2018 11:04:34 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DB46F4204C; Thu, 13 Dec 2018 11:04:33 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AD4584203F; Thu, 13 Dec 2018 11:04:31 +0000 (GMT) Received: from localhost.localdomain (unknown [9.80.105.18]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 13 Dec 2018 11:04:31 +0000 (GMT) Subject: Re: [RFC PATCH v1 0/5] Add support for O_MAYEXEC From: Mimi Zohar To: Matthew Wilcox , =?ISO-8859-1?Q?Micka=EBl_Sala=FCn?= Cc: 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 Date: Thu, 13 Dec 2018 06:04:20 -0500 In-Reply-To: <20181213030228.GM6830@bombadil.infradead.org> References: <20181212081712.32347-1-mic@digikod.net> <20181213030228.GM6830@bombadil.infradead.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18121311-0028-0000-0000-00000329E889 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18121311-0029-0000-0000-000023E63243 Message-Id: <1544699060.6703.11.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-13_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812130100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-12-12 at 19:02 -0800, Matthew Wilcox wrote: > On Wed, Dec 12, 2018 at 09:17:07AM +0100, Mickaël Salaün wrote: > > The goal of this patch series is to control script interpretation. A > > new O_MAYEXEC flag used by sys_open() is added to enable userland script > > interpreter to delegate to the kernel (and thus the system security > > policy) the permission to interpret scripts or other files containing > > what can be seen as commands. > > 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. Mimi