All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Jan Kara <jack@suse.cz>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Shakeel Butt <shakeelb@google.com>
Subject: Re: [PATCH 1/2] fanotify: Avoid lost events due to ENOMEM for unlimited queues
Date: Mon, 26 Feb 2018 14:06:05 +0100	[thread overview]
Message-ID: <20180226130605.v7o3ki53j3aqgdne@quack2.suse.cz> (raw)
In-Reply-To: <CAOQ4uxhct0D3GBhk=62W+0oqie3kaxe6ciQTwLLBUCc93qCFOw@mail.gmail.com>

On Thu 22-02-18 20:34:48, Amir Goldstein wrote:
> On Thu, Feb 22, 2018 at 6:22 PM, Jan Kara <jack@suse.cz> wrote:
> > On Thu 22-02-18 18:04:36, Amir Goldstein wrote:
> >> On Wed, Feb 21, 2018 at 5:44 PM, Jan Kara <jack@suse.cz> wrote:
> >> > Fanotify queues of unlimited length do not expect events can be lost.
> >> > Since these queues are used for system auditing and other security
> >>
> >> Change looks good to me, but the reasoning is going backwards.
> >> IMO, you should mention that we are going to change -ENOMEM
> >> behavior to result in Q_OVERFLOW and user does not expect
> >> Q_OVERFLOW from an UNLIMITED queue.
> >
> > See below.
> >
> >> > related tasks, loosing events can even have security implications. So
> >> > avoid loosing events due to failure to allocate memory by making event
> >> > allocation use __GFP_NOFAIL. Since the allocation is small (32-bytes),
> >> > currently there is no practical difference of this change but still it
> >> > is good to have the expectation explicitely documented.
> >> >
> >>
> >> But if currently allocations cannot fail, then why do we need patch
> >> 2/2 (queue overflow event). It is because small allocations can fail when
> >> accounted to non-root memcg?
> >
> > Yes. So how about changelog like:
> >
> > Fanotify queues of unlimited length do not expect events can be lost.
> > Since these queues are used for system auditing and other security
> > related tasks, loosing events can even have security implications.
> > Currently, since the allocation is small (32-bytes), it cannot fail
> > however when we start accounting events in memcgs, allocation can start
> > failing. So avoid loosing events due to failure to allocate memory by
> > making event allocation use __GFP_NOFAIL.
> >
> 
> Very good.

Can I add your reviewed-by to the patch then?

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2018-02-26 13:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21 15:44 [PATCH 0/2] fsnotify: Improve ENOMEM handling Jan Kara
2018-02-21 15:44 ` [PATCH 1/2] fanotify: Avoid lost events due to ENOMEM for unlimited queues Jan Kara
2018-02-22 16:04   ` Amir Goldstein
2018-02-22 16:22     ` Jan Kara
2018-02-22 18:34       ` Amir Goldstein
2018-02-26 13:06         ` Jan Kara [this message]
2018-02-26 13:17           ` Amir Goldstein
2018-02-21 15:44 ` [PATCH 2/2] fsnotify: Let userspace know about lost events due to ENOMEM Jan Kara
2018-02-22 16:06   ` Amir Goldstein

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=20180226130605.v7o3ki53j3aqgdne@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=amir73il@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=shakeelb@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.