From: Greg KH <gregkh@linuxfoundation.org>
To: Michal Sekletar <msekleta@redhat.com>
Cc: jirislaby@kernel.org, arozansk@redhat.com,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
shuah@kernel.org
Subject: Re: [PATCH v2 1/2] tty: tty_io: update timestamps on all device nodes
Date: Thu, 8 Jun 2023 13:51:19 +0200 [thread overview]
Message-ID: <2023060816-quicken-around-d619@gregkh> (raw)
In-Reply-To: <20230608101616.44152-1-msekleta@redhat.com>
On Thu, Jun 08, 2023 at 12:16:15PM +0200, Michal Sekletar wrote:
> User space applications watch for timestamp changes on character device
> files in order to determine idle time of a given terminal session. For
> example, "w" program uses this information to populate the IDLE column
> of its output [1]. Similarly, systemd-logind has optional feature where
> it uses atime of the tty character device to determine if there was
> activity on the terminal associated with the logind's session object. If
> there was no activity for a configured period of time then logind will
> terminate such session [2].
>
> Now, usually (e.g. bash running on the terminal) the use of the terminal
> will update timestamps (atime and mtime) on the corresponding terminal
> character device. However, if access to the terminal, e.g. /dev/pts/0,
> is performed through magic character device /dev/tty then such access
> obviously changes the state of the terminal, however timestamps on the
> device that correspond to the terminal (/dev/pts/0) are not updated.
>
> This patch makes sure that we update timestamps on *all* character
> devices that correspond to the given tty, because outside observers (w,
> systemd-logind) are maybe checking these timestamps. Obviously, they can
> not check timestamps on /dev/tty as that has per-process meaning.
So how are you protecting this from being an information leak like we
have had in the past where you could monitor how many characters were
being sent to the tty through a proc file? Seems like now you can just
monitor any tty node in the system and get the same information, while
today you can only do it for the tty devices you have permissions for,
right?
thanks,
greg k-h
next prev parent reply other threads:[~2023-06-08 11:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-03 13:36 [PATCH 1/2] tty: tty_io: update timestamps on all device nodes Michal Sekletar
2023-03-03 13:36 ` [PATCH 2/2] selftests: tty: add selftest for tty timestamp updates Michal Sekletar
2023-03-06 8:03 ` [PATCH 1/2] tty: tty_io: update timestamps on all device nodes Jiri Slaby
2023-06-08 10:16 ` [PATCH v2 " Michal Sekletar
2023-06-08 10:16 ` [PATCH v2 2/2] selftests: tty: add selftest for tty timestamp updates Michal Sekletar
2023-06-08 11:49 ` Greg KH
2023-06-08 11:51 ` Greg KH [this message]
[not found] ` <CALVzVJas7g8PrTavpQ01J4vpKtqNP7fYznMMXYEM4K5XbbXRhg@mail.gmail.com>
2023-06-13 10:23 ` [PATCH v2 1/2] tty: tty_io: update timestamps on all device nodes Greg KH
2023-06-13 10:24 ` Greg KH
2023-06-13 17:21 ` [PATCH v3 " Michal Sekletar
2023-06-13 17:21 ` [PATCH v3 2/2] selftests: tty: add selftest for tty timestamp updates Michal Sekletar
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=2023060816-quicken-around-d619@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=arozansk@redhat.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=msekleta@redhat.com \
--cc=shuah@kernel.org \
/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).