Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp15318imu; Mon, 19 Nov 2018 16:52:25 -0800 (PST) X-Google-Smtp-Source: AJdET5chJxl+6Q3B4FNjcufn8aCHIIZjjPcvHxkt7/6tTbXE4MXdf91AIFA+TcfgaGDq/IC1ia4j X-Received: by 2002:a62:1043:: with SMTP id y64-v6mr23330038pfi.79.1542675145385; Mon, 19 Nov 2018 16:52:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542675145; cv=none; d=google.com; s=arc-20160816; b=bCTGYxQAtyNihDOH4UaIReJCBkHiMNOmJvpyB+1S6GkwwxZNA8/Okm5cJJi3m259sD OdIUregLDzUzvuLMlyGdEF9lTFSlZndE5U9PCE3lfkeTuUq+NXruHoLo2yD+WtQrv+gS 0bU7QMD1CcOiwwfzHxjZyHegeQyxGsC5Rg8T+X29p2AJ6gkeP191OrG4uXgHHa7Mn2tg V0srocj0iXwwPSazCrs7L2PhInje5+9hN9QY1w0N0LhSBvkh291/LMJlD4mShUUKB7Q6 znSt5gzx3+/kbpxouYMYkV3NRm4R+k+cc7+z7agzC8NMiPXUJD1yTES8+IFkDqbFPtyH Yjug== 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=UQb3tWVI8yrFAFsceP90VsnGvbNX6EyDf3TzM0jwSVY=; b=CotUU5bJQgH7x3gIhqPZnfs0Ne2wZpopdhKxB/gosfHkFMWkXnL9QZ/S7T5N7Wtdro FHKpLL/oO1N+SOynLCnB8JUuCu6gFQsl6LtXqVlEc8XMvjbFbB2vr0FRtkZ0tmtzvWXy ZFlpOLmjWJ6fPy2HWvzgBnOm3Jy20aLFt9+LE5JcLbzbn5Hp0d+LFeYvmxFmEEzNAGOW 2EnWKHbd/zwTrNqaX8qt6gk8ypewWv+aLQxrJabYPp+QF9WtfugUglmBQONwYL+cZVoU OrdWlvlIvnnx87OGrBGdn3xiqePGjUVnH95Ohwu2nxt6azOglft63Rc5McbrU1tgypyy Q6oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=IhZYC1En; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p8si13382239plk.263.2018.11.19.16.52.08; Mon, 19 Nov 2018 16:52: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=pass header.i=@google.com header.s=20161025 header.b=IhZYC1En; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732566AbeKTLQC (ORCPT + 99 others); Tue, 20 Nov 2018 06:16:02 -0500 Received: from mail-vs1-f67.google.com ([209.85.217.67]:43164 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbeKTLQC (ORCPT ); Tue, 20 Nov 2018 06:16:02 -0500 Received: by mail-vs1-f67.google.com with SMTP id x1so98239vsc.10 for ; Mon, 19 Nov 2018 16:49:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UQb3tWVI8yrFAFsceP90VsnGvbNX6EyDf3TzM0jwSVY=; b=IhZYC1EnzFCFO6JV6fq/YWB5vjm5xHKSp83t81ToOImuLCSpbHwhY/t13JyDpC/39t 1R6QqzIevsBxaPsG9XP+EDR/JPmlps2ueV6MLs5L/fIc1SaiDsgAlLRkgX9tL74Pd4p7 xPVPyTICxz/zF4v6GyWGjmqMxe+Rf6XHb5PxKpbMlevNzskyci6rtwkuuL57b7JQc6UU MohODpLNmFfnOlqZcPdR1lJs6x25gw36r9JrBni0LEOqof7ThXfKMrZYUVT+C205rldY IYRdPoRa3ldArjzJiz1mQITXNcqOFbaYOwf2mcdyLOydQUzhgKgAXhgyFWrqdeQ1zuxk V8tQ== 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=UQb3tWVI8yrFAFsceP90VsnGvbNX6EyDf3TzM0jwSVY=; b=he9gmtJakXtbs9wBqU6RtTvnS+U7opILu1o1rCSdChzflAvl26PmA2x/IwxcHdAJP+ uEWxmHAirnEchs/CV9HndKbiF+nViDYQyNXnUQyUbb7f5/IH+OcesM4mvgS+GmD8+gU6 GdsUyicNWxwHn4X2QZij25Kb9iMnHHkPvNABVmAao0j/ua7YiybYlQPOIkLmBRYqnqMz H+9j7tPQvJrOZlJfzi76J///GZCJcqGGi4Z1OHkRu96loWPp5pM/u/vE0/6NMNE0Rks8 jeJ/kEc2NDRvyxVcQPWWoxOZCPVd+pjDcxsvFaUvCnXUHCWjX409mX6Jgz+zj5DwzOGo cj/w== X-Gm-Message-State: AGRZ1gKxBLNMaERFxC8ke0gbeOArQk9rsnG27qaRsOCnZzqg8weqHJ+E Ztjga3wHZtLQRdY2aS0fXIu+eK/9iOfwWKWg54/XEQ== X-Received: by 2002:a67:6e87:: with SMTP id j129mr10328262vsc.171.1542674978310; Mon, 19 Nov 2018 16:49:38 -0800 (PST) MIME-Version: 1.0 References: <20181119103241.5229-1-christian@brauner.io> <20181119103241.5229-3-christian@brauner.io> <20181119223954.GA4992@cisco> <20181119230709.GB4992@cisco> In-Reply-To: From: Daniel Colascione Date: Mon, 19 Nov 2018 16:49:26 -0800 Message-ID: Subject: Re: [PATCH v1 2/2] signal: add procfd_signal() syscall To: Andy Lutomirski Cc: Tycho Andersen , Christian Brauner , "Eric W. Biederman" , linux-kernel , "Serge E. Hallyn" , Jann Horn , Andrew Morton , Oleg Nesterov , Aleksa Sarai , Al Viro , Linux FS Devel , Linux API , Tim Murray , linux-man , Kees Cook 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 Mon, Nov 19, 2018 at 4:28 PM Andy Lutomirski wrote: > > On Mon, Nov 19, 2018 at 3:07 PM Tycho Andersen wrote: > > > These tools also care about ioctls. Adding a system call is a pain, > > > but the solution is to make adding system calls less of a pain, not to > > > permanently make the Linux ABI worse. > > > > For user-defined values of "worse" :) > > > > I tend to agree with Tycho here. But I'm wondering if it might be > worth considering a better ioctl. > > /me dons flame-proof hat > > We could do: > > long better_ioctl(int fd, u32 nr, const void *inbuf, size_t inlen, > const void *outbuf, size_t outlen); > > and have a central table in the kernel listing all possible nr values > along with which driver they belong to. We could have a sane > signature and get rid of the nr collision problem. The essential difference between a regular system call and an ioctl is that in the former, the invoked kernel-side code depends on the operation number, and in the latter, the invoked kernel-side code depends on the operation number and file descriptor type. By creating a new kind of collision-free ioctl, all you've done is re-invent the system call, but with a funky calling convention and less operand space. It makes no sense. Previous system call multiplexers --- e.g., socketcall --- are widely regarded as mistakes, and there's no reason to repeat these mistakes. System call numbers are not scarce, and your other proposal to clean up the x86 numbering will make wiring up a new system call less annoying. The *only* purpose of an ioctl is to solve the system call numbering coordination problem --- if the invoked kernel-side code depends on (DRIVER, OPERATION_NUMBER), and DRIVER can vary out-of-tree with ioctl, ioctl lets out-of-tree code expose interfaces. For in-tree code, this problem doesn't exist, so there's no reason to use the awkward ioctl workaround!