Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4653443ybl; Mon, 26 Aug 2019 13:49:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRzKA18he76Rup5NrJvQUdjQ1DqpaLPwyNYIzj+n8cI5f29hbDhhRBKY993nWthMXcMayJ X-Received: by 2002:a17:902:9b90:: with SMTP id y16mr20624834plp.17.1566852561359; Mon, 26 Aug 2019 13:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566852561; cv=none; d=google.com; s=arc-20160816; b=LmuLEKnzQA7c/1mYsBjWZoWlDAsOM7Q6OlvaxKFxZldX1jo1aECnI6JqHZTsh7pB/1 HIYgaBsZ8XGuncnnfuTXQ45QNr3CzEGyIbib3wJ1HURw9ypyJYGDytEbEXN23eYs/xKv M3qSMW0mBxOHGkQEdTVyOarOETEoQg0gCsE67SCeh4QUxHeQT6h9hzSNAtNMTXWW64R3 /I+8XGeImUq+3xVpeUE6XZQvCsqAQ4nhkWhEujcIwW3EJN5lWVKgOfdmmKwYAthPy17O soFifZH28+i3uqXoVjS6XLqWepw+hSG5ae+8IMyDUJObuEIR0Ms0P3kXPL+sdD4Ncb6z gUgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:cancel-lock:user-agent:mime-version :references:message-id:date:subject:from:to; bh=YNsmdoti1opobHyEpqz6Iz0Vb8A3AAB3sGJUVnD7Mlg=; b=w8P++wJqFgwJEtWn5p74lN7arLoWPMAnYuL7Vp/9y6lm6Z9L6R56pQp3fYpOAsHCYf 1W1m8RAMsHcjOCBHYzM60MD8eECeG0boxXr4mhJ8x8DCDz/8K6CqR7CCtpEX2KFV5ZvE diHPMWBcZJt+wUh9LzCwekurlNfauRrgNnbcVv2Fv7GSMkThAUFkPwmSFZcpTp1C1+2O YE4iCYpmvt68LNJjC2Tf2pu9AQ2WuH22JiNSLDDQEby3zps0pLsgjphCcw8gBLPpavgT csheTPuHpvXBHOABQvK+pcf4hD3Iw4SLa68plan3dJJXUGEJc+DrrHFHAUvcAdI59WTh SZiQ== 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=catern.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6si9784097pge.44.2019.08.26.13.49.05; Mon, 26 Aug 2019 13:49:21 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=catern.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726760AbfHZUkK (ORCPT + 99 others); Mon, 26 Aug 2019 16:40:10 -0400 Received: from 195-159-176-226.customer.powertech.no ([195.159.176.226]:43708 "EHLO blaine.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbfHZUkJ (ORCPT ); Mon, 26 Aug 2019 16:40:09 -0400 Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1i2LmZ-000222-Ks for linux-kernel@vger.kernel.org; Mon, 26 Aug 2019 22:40:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: linux-kernel@vger.kernel.org From: sbaugh@catern.com Subject: Re: [PATCH RESEND v11 7/8] open: openat2(2) syscall Date: Mon, 26 Aug 2019 19:50:50 +0000 Message-ID: <854l2366zp.fsf@catern.com> References: <20190820033406.29796-1-cyphar@cyphar.com> <20190820033406.29796-8-cyphar@cyphar.com> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cancel-Lock: sha1:ym8TD2+JE56rxevrCvTf9T8Ptcg= Cc: linux-alpha@vger.kernel.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Aleksa Sarai writes: > To this end, we introduce the openat2(2) syscall. It provides all of the > features of openat(2) through the @how->flags argument, but also > also provides a new @how->resolve argument which exposes RESOLVE_* flags > that map to our new LOOKUP_* flags. It also eliminates the long-standing > ugliness of variadic-open(2) by embedding it in a struct. I don't like this usage of a structure in memory to pass arguments that would fit in registers. This would be quite inconvenient for me as a userspace developer. Others have brought up issues with this: the issue of seccomp, and the issue of mismatch between the userspace interface and the kernel interface, are the most important for me. I want to add another, admittedly somewhat niche, concern. This interfaces requires a program to allocate memory (even on the stack) just to pass arguments to the kernel which could be passed without allocating that memory. That makes it more difficult and less efficient to use this syscall in any case where memory is not so easily allocatable: such as early program startup or assembly, where the stack may be limited in size or not even available yet, or when injecting a syscall while ptracing. A struct-passing interface was needed for clone, since we ran out of registers; but we have not run out of registers yet for openat, so it would be nice to avoid this if we can. We can always expand later...