Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp528485ybl; Fri, 9 Aug 2019 09:32:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyc8hzx3UYspzNWRs9O8M67TOd5aadOIFR5s5FElTMedHl7eJ8Qw6b+txenv/5yn1JdI+fB X-Received: by 2002:a17:902:6a87:: with SMTP id n7mr19505430plk.336.1565368340590; Fri, 09 Aug 2019 09:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565368340; cv=none; d=google.com; s=arc-20160816; b=aspRDW4vgnJOAepshy822wGBrHvtFEqjqntftmsMYsq8E6MakAwLuFADv6c/7yZMWs S62StTFecgQU0bfun6Km2yOL5X5voFL6QUMZJr529g7jS9qgcXhhpwllq38dNvzZQhE/ 2o/aRcY1xQfsW1CcV/wYOuBUBpdWO7dD9EsXrrJSC/kgDJ1gauI+8VGy5disbCioXUyc ZcW31q+Sk76vSsR47poK0qg2AVYhhZc2tY7mElcfoPB+cptZJ54P9VWp2bjArf0EQ/cj d99JlELWoTPmb+0GS1xDSrlxKAtp0qVX7Rwizdilnq/hOeSDcxvFwbu0L1VDrR/BKxR8 0/xw== 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=fpmb7aMu+8l69AdkKJAl1XMLapQrrZLpssynUgiongE=; b=atb4oeoQpS95WIun3LZowVL2XMoelCxGX0CjtOj2HC++OLsbdoWGTTHvjDzMgzjPaM oCpHyR7JJfGzwAjRL2YiBg/2fruiH7TtdC9JRhJA2CuaJ/h2y4FgRvehXQHwRN827xd3 /u3J+Cyn0+RuBaWyYtHCLQd9iq1xSX//DGLbmTSgPEk5+A/65Yw6Oazipr1IpjB9YxaU /lZvcgGz/sGiB1jdKivS7q7jRwSVqp/n9jJ+OUp9MHDiIQKXt92uClc9LJPNwvj0GGfV lQMpBK4t+MWNHUOoofSDcT8svrxPQSjCoFXAwQJTQVTfOc2ZA8vnMOVwhv6Jn6v1+mdZ NlsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g24dmDg1; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q7si56819526pgk.456.2019.08.09.09.32.04; Fri, 09 Aug 2019 09:32:20 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g24dmDg1; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437124AbfHIQaL (ORCPT + 99 others); Fri, 9 Aug 2019 12:30:11 -0400 Received: from mail-yw1-f65.google.com ([209.85.161.65]:36954 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726516AbfHIQaK (ORCPT ); Fri, 9 Aug 2019 12:30:10 -0400 Received: by mail-yw1-f65.google.com with SMTP id u141so35780917ywe.4; Fri, 09 Aug 2019 09:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fpmb7aMu+8l69AdkKJAl1XMLapQrrZLpssynUgiongE=; b=g24dmDg1xYHwa/HEx7XJfAc+Oi9Ozx2qOzIklkpRqje3zxC9KRa29lss18EIQATH1C 65NxHQkFieqXmguHo88uvxGo2DVO4fdEEQvDQ9gcUGU/JsvWGjzq+mTqYppELGtFIZbg 9NraSZ74+1lnacaBLVmsSLAqf8RpRFnAHOH2dSIXCzrAfwLyjYD/sg2CBjEMvccKoomF StasBNvtFErsEZ/ST3PSDuZudQaYUoWUhPWP3tzXcxbdGr52N3vOeJSuU2t2prKvu5Az WdcPkB0b5szi5NZEMloHyMWNx83dohB16QS7LZD9e/Idcr8Iy2KmN/GUYOWC6L6P5tXy dTCA== 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=fpmb7aMu+8l69AdkKJAl1XMLapQrrZLpssynUgiongE=; b=oUkO6c8hTgrerPkUc+CIDxKHrIFTuDpU50BpRxV2mKMFy0R/s3ZJ8JGILsySOY9ZiG RyI0zWxvgc12QpsEXDtjaXQF+iHw7UndHbIgL3dvwqQaN2tgdaIBcdM+8Yp7HZx7JwXH 0UM+YdWjKF6G3x183LI9rvwH77ePGf7QVbyOGywWClV282mctN2F3Mb5g4AO9vr8OZ8A NBJKxg2wqcOp/+UWSrdqWz5NyHNFdQ9QuufIDDHUQ0urwVEhqLe7x7agHtIzQ5TmsADB YVVWEk4JVRSbsAu5RT+DqpKsIZSfj/HKPYAVK2xr430trgHcdWuBD5NtYV3TqS+MirhE 23DQ== X-Gm-Message-State: APjAAAU9zpO5XXT4GC0EsKaHrzJbHveBKnwScPkrZmioG9OlKfdE7OiO qz2U61t2Vb8fkJ4ZiI3k8nE3UvSWmACSSSQFdIk= X-Received: by 2002:a81:13d4:: with SMTP id 203mr14520724ywt.181.1565368209677; Fri, 09 Aug 2019 09:30:09 -0700 (PDT) MIME-Version: 1.0 References: <20190731153443.4984-1-acgoide@tycho.nsa.gov> <03ad3773-bea7-77de-0a1f-4bd6f41d3211@tycho.nsa.gov> In-Reply-To: <03ad3773-bea7-77de-0a1f-4bd6f41d3211@tycho.nsa.gov> From: Amir Goldstein Date: Fri, 9 Aug 2019 19:29:57 +0300 Message-ID: Subject: Re: [Non-DoD Source] Re: [PATCH] fanotify, inotify, dnotify, security: add security hook for fs notifications To: Aaron Goidel Cc: Paul Moore , selinux@vger.kernel.org, LSM List , linux-fsdevel , David Howells , Jan Kara , James Morris , Stephen Smalley , linux-kernel 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 ... > >> First a suggestion, take it or leave it. > >> The name of the hook _notify() seems misleading to me. > >> naming the hook security_path_watch() seems much more > >> appropriate and matching the name of the constants FILE__WATCH > >> used by selinux. > > > > I guess I'm not too bothered by either name, Aaron? FWIW, if I was > > writing this hook, I would probably name it > > security_fsnotify_path(...). > > Or even just security_fsnotify() > > While I'm not necessarily attached to the name, I feel as though > "misleading" is too strong a word here. Agree. It is not misleading, but I should note that you yourself named the security class "watch", so why the inconsistency? > Notify seems to be an > appropriate enough term to me as every call to the hook, and thus all > the logic to which the hook adds security, lives in the notify/ subtree. > Well, if nobody cares about the name, it's fine by me. I wanted to point your attention to this proposal by David Howells: https://lore.kernel.org/linux-fsdevel/155991706847.15579.4702772917586301113.stgit@warthog.procyon.org.uk/ His proposal adds new types of watches, for keyring changes, mount changes, etc and he proposed security hooks for setting new watches named "watch_XXX" and for posting notifications called "post_notification". The latter was later rejected by Stephen Smalley: https://lore.kernel.org/linux-fsdevel/cd657aab-e11c-c0b1-2e36-dd796ca75b75@tycho.nsa.gov/ https://lore.kernel.org/linux-fsdevel/541e5cb3-142b-fe87-dff6-260b46d34f2d@tycho.nsa.gov/ Just to have a perspective why the hook name "notify_path" may end up being a bit ambiguous down the road. Thanks, Amir.