linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Cc: Jan Kara <jack@suse.cz>, Steve Grubb <sgrubb@redhat.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-api@vger.kernel.org
Subject: Re: [PATCH v2 1/1] fanotify: introduce new event flag FAN_EXEC
Date: Mon, 1 Oct 2018 12:13:44 +0300	[thread overview]
Message-ID: <CAOQ4uxhD1N7gRJuJE-Mij0cc_AbN1LSmOO=Sa+qL5W9XOOR_vA@mail.gmail.com> (raw)
In-Reply-To: <92b88900-c4be-7acf-b2f4-81d52eab1f5e@mbobrowski.org>

On Mon, Oct 1, 2018 at 11:21 AM Matthew Bobrowski
<mbobrowski@mbobrowski.org> wrote:
>
> Hi Amir,
>
> On 28/09/18 15:39, Amir Goldstein wrote:
> > On Fri, Sep 28, 2018 at 4:28 AM Matthew Bobrowski
> > <mbobrowski@mbobrowski.org> wrote:
> >>
> >> Hi Amir,
> >>
> >> On 27/9/18 11:57 pm, Amir Goldstein wrote:
> >>> [cc: linux-api]
> >>>
> >>> On Thu, Sep 27, 2018 at 4:05 PM Matthew Bobrowski
> >>> <mbobrowski@mbobrowski.org> wrote:
> >>>>
> >>>> This is a reduced version of a patch that I originally submitted a while ago.
> >>>>
> >>>> In short, the fanotify API currently does not provide any means for user space
> >>>> programs to receive events specifically when a file has been opened with the
> >>>> intent to be executed. The FAN_EXEC flag will be set within the event mask when
> >>>> a object has been opened with one of the open flags being __FMODE_EXEC.
> >>>>
> > ...
[...]
> > If Jan accepts my proposal, you can base your patch on:
> > https://github.com/amir73il/linux/commits/fanotify_api-v3
>
> Ok, great. I've gone ahead and written an updated patch that adds the
> ability for programs to explicitly enable the receiving of events that
> contain the "FAN_EXECUTE" bonus flag. Programs will have to provide
> "FAN_ENABLE_EXECUTE" as one of their initialization flags when calling
> fanotify_init() in order to receive any events where the "FAN_EXECUTE" flag
> has been set. I think doing it this way would be a far better solution to
> mitigate possibly breaking any existing programs.
>
> You can find the patch here:
> https://github.com/matthewbobrowski/linux/commit/3325b3bbd8613b0de1dd6bac24b52c481b760f1d
>
> These changes are based off your branch 'fanotify_api-v3'. Let me know what
> you think.
>

Besides some nits I left in github:

I personally liked FAN_EXEC, better than FAN_EXECUTE.
If you have a string argument in favor of latter please share it.

Your changes enables receiving the FAN_EXEC "bonus" flag, but not to
request (or ignore) FAN_EXEC events (you did not add it to FAN_USER_EVENTS).
But you should also add a check in do_fanotify_mark() to return -EINVAL when
FAN_EXEC event mask was specified, but group has no FAN_ENABLE_EXEC.

So to clarify, if group has FAN_ENABLE_EXEC, the "bonus" flag can be
reported even if not requested (e.g. requested only FAN_OPEN), but if
user wishes
to get only FAN_EXEC events or only FAN_OPEN events that are not FAN_EXEC
user needs to first enable exec events in fanotify_init.

Thanks,
Amir.

  reply	other threads:[~2018-10-01 15:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-27 13:05 [PATCH v2 1/1] fanotify: introduce new event flag FAN_EXEC Matthew Bobrowski
2018-09-27 13:57 ` Amir Goldstein
2018-09-28  1:27   ` Matthew Bobrowski
2018-09-28  5:39     ` Amir Goldstein
2018-10-01  8:21       ` Matthew Bobrowski
2018-10-01  9:13         ` Amir Goldstein [this message]
2018-10-01 10:58 ` Jan Kara
2018-10-01 14:01   ` Amir Goldstein
2018-10-02  9:24     ` Jan Kara
2018-10-02 10:37       ` Amir Goldstein
2018-10-03 15:40         ` Jan Kara
2018-10-03 16:18           ` Amir Goldstein
2018-10-03 16:33             ` Jan Kara
2018-10-03 20:45               ` Matthew Bobrowski
2018-10-07 11:13               ` Matthew Bobrowski
2018-10-07 13:40                 ` Amir Goldstein
2018-10-08  9:35                 ` Jan Kara
2018-10-02 11:50       ` Matthew Bobrowski
2018-10-03 15:45         ` Jan Kara
2018-10-01 11:06 ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOQ4uxhD1N7gRJuJE-Mij0cc_AbN1LSmOO=Sa+qL5W9XOOR_vA@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mbobrowski@mbobrowski.org \
    --cc=sgrubb@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).