Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2452836ybe; Sat, 7 Sep 2019 16:15:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+bBkhrggfRemUl/e1UDX40kYBxs+85wBS66/zYd0VAxNMW2xHhc6c/Am2c28H9n0K1LQy X-Received: by 2002:a63:6888:: with SMTP id d130mr13932896pgc.197.1567898146722; Sat, 07 Sep 2019 16:15:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567898146; cv=none; d=google.com; s=arc-20160816; b=JAaOo09G2Bcp3Q4A/VRCBdC5B25CaXbsTZxKpEdYQp0al9VrGQq/mwwxdrBwu8vS3M LAMIumPEf7Z7Ki1Gk+4FI95tVVPUWrKrsyFtI2j4FCkoMNWt1OytNwRj3Z4xnBAZKRVd /54Jh6DWbFr+c2oqAutptCKYvE3gE9JmVO1VyOt8KTcsyAd32eXb8/Wf7B5VSWnc5ZeJ b66kGvqLKMMnAR0J/OoqZ8TgysWqL8dQeviAUbx0PFyhpaIEKlbXOlim1fqoIxeRGVEq JJY0sBPRFRTM5V/JSW5Mmo2D5LZ3oqSmZ0VJjK3HxDMjbFipJ1nTqfYrcDpTUFCuxFiZ xwcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=r2+dymRs1mWNjUKjMYB3+oZQNv2osfzddlR+oYx6/uE=; b=oTXHNwQJcnPz8dfcceqa7nS3jtVD4cqGKo93LcbzcRuBbGyKCAd2ZlQid9lJWytKzE o55Q2JmS5yIB3XJGl3xoX/XcDmmiggcWkont1ovAwhikFcjVtFH83+b4l9e8tj3mmeqq xmKZgxCml5etERxk+F76bRuDf5yTBLzDithe6cVRjUqB2QIpj78aRe/h9fY/EgSJPA5h 4Zr3YjXvuA1eZqev6H92bUYGoQjbc5oFoDAebcy2m5qjl9tRnARFNLOnjlsPzq+r8mvb VTxZ0MvXoSKc21WYm/0gbK+n75f4tpVhzRnejYfftqwWeVBETmefGPmr6ipLkz6+i2f/ 9wcg== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r133si10877684pfc.16.2019.09.07.16.15.17; Sat, 07 Sep 2019 16:15:46 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393365AbfIFTdS convert rfc822-to-8bit (ORCPT + 99 others); Fri, 6 Sep 2019 15:33:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40732 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393338AbfIFTdS (ORCPT ); Fri, 6 Sep 2019 15:33:18 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 874056696C for ; Fri, 6 Sep 2019 19:33:17 +0000 (UTC) Received: by mail-wr1-f72.google.com with SMTP id n6so2979696wrw.14 for ; Fri, 06 Sep 2019 12:33:17 -0700 (PDT) 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:content-transfer-encoding; bh=R/U7mUhygsddH+fGB+zy3E9CKa5h+Z8Nm54osdGuOgs=; b=IIQaZ5ZbKWDmWOAV6GpNgweeUAy/KpDQb4NjZON+aWmQwWFJx0dAnmYJLsuoexnGe4 XL1Kd9giN31oLGZfgJ5ZEkh3gC+SOLOwlvYQEE2QHPpHf87SqQU8wDghXRhLTANPX8Gc FOuoCjbasc54dOHz6JspATWPctibhxu9jRwPcq1itFyvRs7zfTatiMLBLB4ejv180nA9 3Wur0y0KYDSIlvYLExE9eBA8ywvSOmPCv340/eDNIJ/BGHlCeSxqJud8lxvOPnrgwMvB CqGDNBupObQNyb7zqS4n5vHxsrsuNiylZM91XY+Rkx4wHWexRPAfOmNcbfGHDOY6Ydpa ajmw== X-Gm-Message-State: APjAAAWzC7svmrEeTOCzlFfC1Lx9whVmwdERZ5XLBNHF+fz1rtlyUWjy TFrIPUqRDM0R/N7xiVsiNhrHdU4hEXbIy7lI+KUOv3HgIkrzoSshggrTr4FvdTwDR/Be99umMv3 nGHObzr44X+0VRCV2xm12X1aKl4An52fKs20gsqtU X-Received: by 2002:a1c:ca02:: with SMTP id a2mr9252538wmg.127.1567798396045; Fri, 06 Sep 2019 12:33:16 -0700 (PDT) X-Received: by 2002:a1c:ca02:: with SMTP id a2mr9252505wmg.127.1567798395711; Fri, 06 Sep 2019 12:33:15 -0700 (PDT) MIME-Version: 1.0 References: <156763534546.18676.3530557439501101639.stgit@warthog.procyon.org.uk> <17703.1567702907@warthog.procyon.org.uk> In-Reply-To: From: Ray Strode Date: Fri, 6 Sep 2019 15:32:37 -0400 Message-ID: Subject: Re: Why add the general notification queue and its sources To: Linus Torvalds Cc: David Howells , Greg Kroah-Hartman , Steven Whitehouse , Nicolas Dichtel , raven@themaw.net, keyrings@vger.kernel.org, linux-usb@vger.kernel.org, linux-block , Christian Brauner , LSM List , linux-fsdevel , Linux API , Linux List Kernel Mailing , Al Viro , "Ray, Debarshi" , Robbie Harwood Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Sep 5, 2019 at 4:39 PM Linus Torvalds wrote: > That is *way* too specific to make for any kind of generic > notification mechanism. Well from my standpoint, I just don't want to have to poll... I don't have a strong opinion about how it looks architecturally to reach that goal. Ideally, at a higher level, I want the userspace api that gnome uses to be something like: err = krb5_cc_watch (ctx, ccache, (krb5_cc_change_fct) on_cc_change , &watch_fd); then a watch_fd would get handed back and caller could poll on it. if it woke up poll(), caller would do krb5_cc_watch_update (ctx, ccache, watch_fd) or so and it would trigger on_cc_change to get called (or something like that). If under the hood, fd comes from opening /dev/watch_queue, and krb5_cc_watch_update reads from some mmap'ed buffer to decide whether or not to call on_cc_change, that's fine with me. If under the hood, fd comes from a pipe fd returned from some ioctl or syscall, and krb5_cc_watch_update reads messages directly from that fd to decide whether or not to call on_cc_change, that's fine with me. too. it could be an eventfd too, or whatever, too, just as long as its something I can add to poll() and don't have to intermittently poll ... :-) > Also, what is the security model here? Open a special character > device, and you get access to random notifications from random > sources? I guess dhowells answered this... > And why would you do a broken big-key thing in the kernel in the first > place? Why don't you just have a kernel key to indirectly encrypt > using a key and "additional user space data". The kernel should simply > not take care of insane 1MB keys. ???? dunno. I assume you're referencing the discussions from comment 0 on that 2013 bug. I wasn't involved in those discussions, I just chimed in after they happened trying to avoid having to add polling :-) I have no idea why a ticket would get that large. I assume it only is in weird edge cases. Anyway, gnome treats the tickets as opaque blobs. it doesn't do anything with them other than tell the user when they need to get refreshed... all the actual key manipulation happens from krb5 libraries. of course, one advantage of having the tickets kernel side is nfs could in theory access them directly, rather than up calling back to userspace... --Ray