Re: [gentoo-user] Re: Root can't write to files owned by others?

2022-03-11 Thread Mark Knecht
On Fri, Mar 11, 2022 at 12:26 PM Rich Freeman wrote: > > On Fri, Mar 11, 2022 at 1:23 PM Mark Knecht wrote: > > > > To me the overriding idea of not letting any user, including root, > > mess around in a pipe makes logical sense, but as the OP has showed I > > guess there were valid uses for

Re: [gentoo-user] Re: Root can't write to files owned by others?

2022-03-11 Thread Rich Freeman
On Fri, Mar 11, 2022 at 1:23 PM Mark Knecht wrote: > > To me the overriding idea of not letting any user, including root, > mess around in a pipe makes logical sense, but as the OP has showed I > guess there were valid uses for this feature pre-patch, and it seems > that a user can override the

Re: [gentoo-user] Re: Root can't write to files owned by others?

2022-03-11 Thread Mark Knecht
On Fri, Mar 11, 2022 at 10:06 AM Nikos Chantziaras wrote: > > On 11/03/2022 17:06, Mark Knecht wrote: > > Is this related to the 'dirty pipe' vulnerability that has been in the > > news of late and has gotten patched in most distros in the last few > > days? > > In one of the discussions about

[gentoo-user] Re: Root can't write to files owned by others?

2022-03-11 Thread Nikos Chantziaras
On 11/03/2022 17:06, Mark Knecht wrote: Is this related to the 'dirty pipe' vulnerability that has been in the news of late and has gotten patched in most distros in the last few days? In one of the discussions about the patch, it was mentioned that "a couple of CVEs would have never

RE: [gentoo-user] Re: Root can't write to files owned by others?

2022-03-11 Thread Laurence Perkins
>-Original Message- >From: Neil Bothwick >Sent: Friday, March 11, 2022 6:59 AM >To: gentoo-user@lists.gentoo.org >Subject: Re: [gentoo-user] Re: Root can't write to files owned by others? > >On Fri, 11 Mar 2022 12:38:48 +0100, Dr Rainer Woitok wrote: > >&

Re: [gentoo-user] Re: Root can't write to files owned by others?

2022-03-11 Thread Mark Knecht
On Fri, Mar 11, 2022 at 7:59 AM Neil Bothwick wrote: > > On Fri, 11 Mar 2022 12:38:48 +0100, Dr Rainer Woitok wrote: > > > No. My "/tmp/" directory is not mounted at all, it is just a genuine > > directory in "/". And that root CAN overwrite a file it doesn't own in > > other directories,

Re: [gentoo-user] Re: Root can't write to files owned by others?

2022-03-11 Thread Neil Bothwick
On Fri, 11 Mar 2022 12:38:48 +0100, Dr Rainer Woitok wrote: > No. My "/tmp/" directory is not mounted at all, it is just a genuine > directory in "/". And that root CAN overwrite a file it doesn't own in > other directories, is due to most directories not having the sticky bit > set

Re: [gentoo-user] Re: Root can't write to files owned by others?

2022-03-11 Thread Dr Rainer Woitok
Aho, On Friday, 2022-03-11 10:17:13 +0100, you wrote: > ... > I think Rainer's problem is the nosuid mount flag on his /tmp > > $ mount | grep \/tmp > tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime,size=3212160k,inode64) > > So if he would run the command against a file not located in /tmp

Re: [gentoo-user] Re: Root can't write to files owned by others?

2022-03-11 Thread Michael
On Friday, 11 March 2022 03:04:47 GMT Nikos Chantziaras wrote: > On 10/03/2022 20:44, Michael wrote: > > ~ # sysctl -a | grep fs.protected_regular > > fs.protected_regular = 1 > > To check the current value of a setting, you can just run: > >sysctl fs.protected_regular > > No grep or root

[gentoo-user] Re: Root can't write to files owned by others?

2022-03-10 Thread Nikos Chantziaras
On 10/03/2022 20:44, Michael wrote: ~ # sysctl -a | grep fs.protected_regular fs.protected_regular = 1 To check the current value of a setting, you can just run: sysctl fs.protected_regular No grep or root needed.

Re: [gentoo-user] Re: Root can't write to files owned by others?

2022-03-10 Thread Peter Böhm
Here is the kernel patch: https://git.kernel.org/pub/scm/linux/kernel/git/ torvalds/linux.git/commit/?id=30aba6656f61ed44cba445a3c0d38b296fa9e8f5 for this: Am Donnerstag, 10. März 2022, 19:44:46 CET schrieb Michael: > > Just checked and it is so, on openrc: > > ~ # uname -r > 5.15.26-gentoo >

Re: [gentoo-user] Re: Root can't write to files owned by others?

2022-03-10 Thread Michael
On Thursday, 10 March 2022 17:59:00 GMT Laurence Perkins wrote: > >-Original Message- > >From: Dr Rainer Woitok > >Sent: Thursday, March 10, 2022 9:51 AM > >To: gentoo-user@lists.gentoo.org; Nikos Chantziaras > >Subject: [gentoo-user] Re: Root can't

RE: [gentoo-user] Re: Root can't write to files owned by others?

2022-03-10 Thread Laurence Perkins
> > >-Original Message- >From: Dr Rainer Woitok >Sent: Thursday, March 10, 2022 9:51 AM >To: gentoo-user@lists.gentoo.org; Nikos Chantziaras >Subject: [gentoo-user] Re: Root can't write to files owned by others? > >Nikos, > >On Thursday, 202

[gentoo-user] Re: Root can't write to files owned by others?

2022-03-10 Thread Dr Rainer Woitok
Nikos, On Thursday, 2022-03-10 12:21:36 +0200, you wrote: > ... > Are you sure that: > > sysctl fs.protected_regular=0 > > does not help? I can reproduce it here on my system with kernel 5.15.27, > and setting that sysctl to 0 fixes it immediately. No, I'm not at all sure. Since you

Re: [gentoo-user] Re: Root can't write to files owned by others?

2022-03-10 Thread Grant Taylor
On 3/9/22 11:50 PM, Nikos Chantziaras wrote: This is normal, at least when using systemd. How is this a /systemd/ thing? Is it because systemd is enabling a /kernel/ thing that probably is otherwise un(der)used? I ask as someone who disliked systemd as many others do. But I fail to see

RE: [gentoo-user] Re: Root can't write to files owned by others?

2022-03-10 Thread Laurence Perkins
>On 09/03/2022 20:28, Dr Rainer Woitok wrote: >> until recently my system behaves sort of strangely: >> >> $ echo x | sudo tee /tmp/file >> Password: >> tee: /tmp/file: Permission denied >> [...] >> >> Since when can't root write to files it doesn't own? And not even, if >>

Re: [gentoo-user] Re: Root can't write to files owned by others?

2022-03-10 Thread Björn Fischer
Hello Rainer, Big thanks to all kind people making suggestions. But up to now nothing helped. on my rig I can fully reproduce Nikos' statement. Additionally, on 5.15.16 "fs.protected_regular" defaults to "0" while on 5.15.27 it defaults to "1". Cheers, Björn

[gentoo-user] Re: Root can't write to files owned by others?

2022-03-10 Thread Nikos Chantziaras
On 10/03/2022 11:55, Dr Rainer Woitok wrote: Big thanks to all kind people making suggestions. But up to now nothing helped. Are you sure that: sysctl fs.protected_regular=0 does not help? I can reproduce it here on my system with kernel 5.15.27, and setting that sysctl to 0 fixes it

[gentoo-user] Re: Root can't write to files owned by others?

2022-03-10 Thread Dr Rainer Woitok
Greetings, On Wednesday, 2022-03-09 19:28:49 +0100, I myself wrote: > ... >$ touch /tmp/file >$ ls -l /tmp/file >-rw--- 1 rainer rainer 0 2022-03-09 19:06 /tmp/file >$ echo x | sudo tee /tmp/file >Password: >tee: /tmp/file: Permission denied >x >$ ... >$

[gentoo-user] Re: Root can't write to files owned by others?

2022-03-09 Thread Nikos Chantziaras
On 09/03/2022 20:28, Dr Rainer Woitok wrote: until recently my system behaves sort of strangely: $ echo x | sudo tee /tmp/file Password: tee: /tmp/file: Permission denied [...] Since when can't root write to files it doesn't own? And not even, if the file has write