From: Isaac Manjarres <isaacmanjarres@google.com>
To: Christian Brauner <brauner@kernel.org>
Cc: tglx@linutronix.de, jstultz@google.com,
"Rafael J. Wysocki" <rafael@kernel.org>,
Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
saravanak@google.com, mjguzik@gmail.com,
Manish Varma <varmam@google.com>,
Kelly Rossmoyer <krossmo@google.com>,
kernel-team@android.com, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v6] fs: Improve eventpoll logging to stop indicting timerfd
Date: Tue, 9 Jul 2024 14:04:43 -0700 [thread overview]
Message-ID: <Zo2l65cTwuSMDU-Z@google.com> (raw)
In-Reply-To: <20240704-umsatz-drollig-38db6b84da7b@brauner>
On Thu, Jul 04, 2024 at 04:03:59PM +0200, Christian Brauner wrote:
> On Wed, Jul 03, 2024 at 02:43:14PM GMT, Isaac J. Manjarres wrote:
> > From: Manish Varma <varmam@google.com>
> >
> > We'll often see aborted suspend operations that look like:
> >
> > PM: suspend entry 2024-07-03 15:55:15.372419634 UTC
> > PM: PM: Pending Wakeup Sources: [timerfd]
> > Abort: Pending Wakeup Sources: [timerfd]
> > PM: suspend exit 2024-07-03 15:55:15.445281857 UTC
> >
> > From this, it seems a timerfd caused the abort, but that can be
> > confusing, as timerfds don't create wakeup sources. However,
> > eventpoll can, and when it does, it names them after the underlying
> > file descriptor. Unfortunately, all the file descriptors are called
> > "[timerfd]", and a system may have many timerfds, so this isn't very
> > useful to debug what's going on to cause the suspend to abort.
> >
> > To improve this, change the way eventpoll wakeup sources are named:
> >
> > 1) The top-level per-process eventpoll wakeup source is now named
> > "epollN:P" (instead of just "eventpoll"), where N is a unique ID token,
> > and P is the PID of the creating process.
> >
> > 2) Individual eventpoll item wakeup sources are now named
> > "epollitemN:P.F", where N is a unique ID token, P is PID of the creating
> > process, and F is the name of the underlying file descriptor.
>
> Fyi, that PID is meaningless or even actively misleading in the face of
> pid namespaces. And since such wakeups seem to be registered in sysfs
> globally they are visible to all containers. That means a container will
> now see some timerfd wakeup source with a PID that might just accidently
> correspond to a process inside the container. Which in turn also means
Thanks for your feedback on this, Christian. With regards to this
scenario: would it be useful to use a namespace ID, along with the PID,
to uniquely identify the process? If not, do you have a suggestion for
this?
I understand that the proposed naming scheme has a chance of causing
collisions, however, it is still an improvement over the existing
naming scheme in terms of being able to attribute wakeups to a
particular application.
> you're leaking the info about the creating process into the container.
> IOW, if PID 1 ends up registering some wakeup source the container gets
> to know about it.
Is there a general security concern about this? If not, can you please
elaborate why this is a problem?
Thanks,
Isaac
next prev parent reply other threads:[~2024-07-09 21:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 21:43 [PATCH v6] fs: Improve eventpoll logging to stop indicting timerfd Isaac J. Manjarres
2024-07-04 12:31 ` Rafael J. Wysocki
2024-07-04 14:03 ` Christian Brauner
2024-07-09 21:04 ` Isaac Manjarres [this message]
2024-07-29 18:35 ` Isaac Manjarres
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=Zo2l65cTwuSMDU-Z@google.com \
--to=isaacmanjarres@google.com \
--cc=brauner@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jack@suse.cz \
--cc=jstultz@google.com \
--cc=kernel-team@android.com \
--cc=krossmo@google.com \
--cc=len.brown@intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mjguzik@gmail.com \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
--cc=saravanak@google.com \
--cc=tglx@linutronix.de \
--cc=varmam@google.com \
--cc=viro@zeniv.linux.org.uk \
/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).