From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Andrew Lunn <andrew@lunn.ch>, Wojtek Wasko <wwasko@nvidia.com>
Cc: richardcochran@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH] ptp: Add sysfs attribute to show clock is safe to open RO
Date: Wed, 14 May 2025 16:25:43 +0100 [thread overview]
Message-ID: <c2d4a2ce-8af6-4dda-87e5-2cff14fd14b1@linux.dev> (raw)
In-Reply-To: <64de5996-1120-4c06-9782-a172e83f9eb3@lunn.ch>
On 14/05/2025 15:54, Andrew Lunn wrote:
> On Wed, May 14, 2025 at 05:36:21PM +0300, Wojtek Wasko wrote:
>> Recent patches introduced in 6.15 implement permissions checks for PTP
>> clocks. Prior to those, a process with readonly access could modify the
>> state of PTP devices, in particular the generation and consumption of
>> PPS signals.
>>
>> Userspace (e.g. udev) managing the ownership and permissions of device
>> nodes lacks information as to whether kernel implements the necessary
>> security checks and whether it is safe to expose readonly access to
>> PTP devices to unprivileged users. Kernel version checks are cumbersome
>> and prone to failure, especially if backports are considered [1].
>>
>> Add a readonly sysfs attribute to PTP clocks, "ro_safe", backed by a
>> static string.
>
> ~/linux$ grep -r "ro_safe"
> ~/linux$
>
> At minimum, this needs documentation.
>
> But is this really the first time an issue like this has come up?
I haven't seen such kind of discussions previously, but it's more about
netdev area only. The original problem was kinda hidden because all
modern distros had udev rules preventing non-root access to PHC devices,
which effectively means no strict access checks are needed. I cannot
find a good example of device with the same issues quickly...
> Also, what was the argument for adding permission checks, and how was
> it argued it was not an ABI change?
The original discussion was in the thread:
https://lore.kernel.org/netdev/DM4PR12MB8558AB3C0DEA666EE334D8BCBEE82@DM4PR12MB8558.namprd12.prod.outlook.com/
while the change has landed in:
https://lore.kernel.org/netdev/20250303161345.3053496-1-wwasko@nvidia.com/
next prev parent reply other threads:[~2025-05-14 15:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 14:36 [PATCH] ptp: Add sysfs attribute to show clock is safe to open RO Wojtek Wasko
2025-05-14 14:54 ` Andrew Lunn
2025-05-14 15:25 ` Vadim Fedorenko [this message]
2025-05-15 12:48 ` Wojtek Wasko
2025-05-15 13:40 ` Jakub Kicinski
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=c2d4a2ce-8af6-4dda-87e5-2cff14fd14b1@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=andrew@lunn.ch \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=wwasko@nvidia.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).