<div dir="auto"><div><br><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, 14 Feb 2025, 18:45 Darrick J. Wong, <<a href="mailto:djwong@kernel.org">djwong@kernel.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Feb 14, 2025 at 12:13:03PM -0600, Elizabeth Figura wrote:<br>
> On Friday, 14 February 2025 07:06:20 CST Greg Kroah-Hartman wrote:<br>
> > On Fri, Feb 14, 2025 at 12:28:00PM +0000, Mike Lothian wrote:<br>
> > > This allows ntsync to be usuable by non-root processes out of the box<br>
> > <br>
> > Are you sure you need/want that? If so, why? How did existing testing<br>
> > not ever catch this?<br>
> <br>
> Hi, sorry, this is of course my fault.<br>
> <br>
> We do need /dev/ntsync to be openable from user space for it to be<br>
> useful. I'm not sure what the most "correct" permissions are to have<br>
> in this case (when we don't specifically need read or write), but I<br>
> don't think I see a reason not to just set to 666 or 444.<br>
> <br>
> I originally assumed that the right way to do this was not to set the<br>
> mode on the kernel file but rather through udev; I believe I was using<br>
> the code for /dev/loop-control or /dev/fuse as an example, which both<br>
> do that. So I (and others who tested) had just manually set up udev<br>
> rules for this, with the eventual intent of adding a default rule to<br>
> systemd like the others. I only recently realized that doing something<br>
> like this patch is possible and precedented.<br>
> <br>
> I don't know what the best way to address this is, but this is<br>
> certainly the simplest.<br>
<br>
Paranoid defaults in the kernel, and then a udev rule to relax the mode<br>
at runtime. You could also have logind scripts to add add per-user<br>
allow acls to the device file at user session set up time... or however<br>
it is that /dev/sr0 has me on the allow list. I'm not sure how that<br>
happens exactly, but it works smoothly.<br>
<br>
I get far less complaining about relaxing posture than tightening it<br>
(==breaking things) after the fact.<br>
<br>
--D<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I did create a MR for systemd first <a href="https://github.com/systemd/systemd/pull/36384">https://github.com/systemd/systemd/pull/36384</a></div><div dir="auto"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>