
Of course.GDH-gentoo wrote:The dev (and apparently also the rest of opentmpfiles' developers) didn't want to support it anymore because he believed that fixing the security issue was too much work (among other things):Naib wrote:Essentially there was a flurry that opnetmpfiles was being removed due to security issues (issues that were known and were argued not as sever for well over a year and equally systemd-tmpfiles.d had a comparable issue [unsure if they resolved at the time]). News was pushed out, forum posts by devs... UNTIL it came out that basically the dev just didn't want to support it anymore
(source)williamh wrote:Here are my thoughts about opentmpfiles and systemd-tmpfiles.Given this, I'm fine with systemd-tmpfiles for now since maintaining opentmpfiles feels like a lot of work without much benefit.
- [...]
- opentmpfiles is vulnerable to a cve. I think mitigating this will take a complete rewrite in C.
- If we do rewrite in C, we are echoing work that has already been done in systemd-tmpfiles.
- I've been told that systemd-tmpfiles works fine on gentoo musl as well.
[...]- systemd-tmpfiles is part of the systemd tarball, but it runs fine standalone, like udev does.
Do you believe that he is being dishonest?

I think that idea of just writing a tool in C is an interesting new point, because it reflects to the "one tool one job" idea of Unix. In fact, I was feeling encouraged again to write such a tool (as I previously thought about re-implementing systemd-tmpfiles), but then I remembered why such a tool was not already provided by standard unix tools: It is exactly because it cannot be provided by such "one tool one job" helpers: You really need to do all steps in C. And then practically, we are back at (almost) a full re-implementation in C. (And then indeed just the arguments against a full re-implementation hold for such a tool as well.)NeddySeagoon wrote:That's a good summary of the ML discussion.
I don't know if your post was intended that way[...]
This was all discussed before, but I am too lazy too look up the old threads:szatox wrote:What is wrong with changes not being atomic? If root creates a directory for an application, this directory is owned by root and not writable to anyone else.
Thanks. This is the point I tried to make earlier: it makes it a lot easier to safely write an init script and avoid footguns. And there's a pile of cases I gave earlier (non-exhaustive) where it would've at least partly helped.mv wrote:This was all discussed before, but I am too lazy too look up the old threads:szatox wrote:What is wrong with changes not being atomic? If root creates a directory for an application, this directory is owned by root and not writable to anyone else.
Essentially, the thing is: As long as some additional assumptions are met, it is not a problem. These additional assumptions are essentially:A first glance, both assumptions appear safe to make for a gentoo/openrc-only system. But at second glance, they are not: Also for openrc, there are occasionally reasons to restart a service which (depending on the service) might re-execute a tmpfiles.d processing. Actually, usually even ebuilds process some tmpefiles.d so that they can function after installation and before a reboot. Moreover, not every package author is a security expert (and the idea of tmpfiles.d is that they need not be). Do you really want to manually inspect all tmpfiles.d files after every installation of a package and verify that they are sane? Are you experienced enough to judge this? Do you expect the same for every gentoo/openrc user?
- No untrusted process must run before tmpfiles.d is processed
- All tmpfiles.d files are sane, e.g. involve only top-level directories like /tmp/subdir (not /tmp/subdir/exploitable-thingy), no recursive permission changes, etc.
If really both assumptions are violated together on a system, and an attacker knows this, they can produce a privilege escalation once they have an exploit to execute code as some user (the latter is usually relatively cheap to get as such vulnerabilities are relatively frequent).

This reminds me of some signature (wasn't it NeddySeagoon's one once?): There are two kind of people. Those who never lost data and those who make backups.Anon-E-moose wrote:Would be interesting to see how many exploits actually happened
I dont know an exploit of this ... but ... it is the same principle as the exploit Microsoft has found with networkd-dispatcher (from systemd) here (I think you already know it):Anon-E-moose wrote:Would be interesting to see how many exploits actually happened with the old tmpfiles code vs the hubris.
It seems from all I've read, that this was just a theoretical problem, ie it might happen in the future

1st I didn't say anything about keeping code, I was talking about exploits and have no stand on replacing it, so try not to put me in the wrong campmv wrote:But I do not see why this should be any argument to keep known vulnerable code if you can replace it by code in which these vulnerabilities are known to be gone,
Just to clarify again: networkd-dispatcher isn't a part of systemd (it's some sort of plugin or addon) and it's also not packaged in Gentoo even for systemd users.pietinger wrote:I dont know an exploit of this ... but ... it is the same principle as the exploit Microsoft has found with networkd-dispatcher (from systemd) here (I think you already know it):Anon-E-moose wrote:Would be interesting to see how many exploits actually happened with the old tmpfiles code vs the hubris.
It seems from all I've read, that this was just a theoretical problem, ie it might happen in the future
https://www.microsoft.com/security/blog ... nimbuspwn/
So, it should be possible to exploit it, if it would be done insecure ...
(Info: I am an OpenRC-User and I "dont like" systemd ... but I have no problem with using parts of systemd IF they can help us)
The dev team were being dishonest yes.GDH-gentoo wrote:The dev (and apparently also the rest of opentmpfiles' developers) didn't want to support it anymore because he believed that fixing the security issue was too much work (among other things):Naib wrote:Essentially there was a flurry that opnetmpfiles was being removed due to security issues (issues that were known and were argued not as sever for well over a year and equally systemd-tmpfiles.d had a comparable issue [unsure if they resolved at the time]). News was pushed out, forum posts by devs... UNTIL it came out that basically the dev just didn't want to support it anymore
(source)williamh wrote:Here are my thoughts about opentmpfiles and systemd-tmpfiles.Given this, I'm fine with systemd-tmpfiles for now since maintaining opentmpfiles feels like a lot of work without much benefit.
- [...]
- opentmpfiles is vulnerable to a cve. I think mitigating this will take a complete rewrite in C.
- If we do rewrite in C, we are echoing work that has already been done in systemd-tmpfiles.
- I've been told that systemd-tmpfiles works fine on gentoo musl as well.
[...]- systemd-tmpfiles is part of the systemd tarball, but it runs fine standalone, like udev does.
Do you believe that he is being dishonest?
This wasn't said by some random Gentoo dev, it was the former eudev lead:Naib wrote:EXACTLY what happened with eudev, the reason it was created was twisted to be "oh its not needed anymore as systemd-udev supports musl" [...]
(source)blueness wrote:My original purpose for maintaining eudev was because systemd + musl did not play well together when udev was absorbed into the sytemd repo. Now thanks to patches from openembedded, they do, and my original reason for maintaining eudev is no longer valid. So its time to retire eudev. It has served its purpose as a stop-gap.(source)blueness wrote:> Are there any concerns about upstream one day making udev and systemd
> inseparable again?
I can't address this. There are two issues: 1) making sure there is a device manager for musl. 2) making sure there is a device manager which is independent of systemd. My concern was the former, hence eudev. If one day I have to use systemd on a musl system, so be it. If anyone is concerned about the second issue, they are welcome to maintain eudevMy life circumstances have changed and I don't have the time or will.
Do you believe that he is being dishonest?
I agree, this one of the over thinking engineerAnon-E-moose wrote:It seems from all I've read, that this was just a theoretical problem, ie it might happen in the future
That doesn't answer the eudev part. Anyway, as for opentmpfiles, bug 751415, had no reply in Gentoo or on the upstream bug tracker. Undisputed vulnerabilities with no response or fix upstream are generally candidates for masking or last-rites/removal. Someone making an error, there being an oversight, or nobody bothering to explain from an opentmpfiles perspective why something is fine is not being dishonest.Naib wrote:The dev team were being dishonest yes.GDH-gentoo wrote:The dev (and apparently also the rest of opentmpfiles' developers) didn't want to support it anymore because he believed that fixing the security issue was too much work (among other things):Naib wrote:Essentially there was a flurry that opnetmpfiles was being removed due to security issues (issues that were known and were argued not as sever for well over a year and equally systemd-tmpfiles.d had a comparable issue [unsure if they resolved at the time]). News was pushed out, forum posts by devs... UNTIL it came out that basically the dev just didn't want to support it anymore
(source)williamh wrote:Here are my thoughts about opentmpfiles and systemd-tmpfiles.Given this, I'm fine with systemd-tmpfiles for now since maintaining opentmpfiles feels like a lot of work without much benefit.
- [...]
- opentmpfiles is vulnerable to a cve. I think mitigating this will take a complete rewrite in C.
- If we do rewrite in C, we are echoing work that has already been done in systemd-tmpfiles.
- I've been told that systemd-tmpfiles works fine on gentoo musl as well.
[...]- systemd-tmpfiles is part of the systemd tarball, but it runs fine standalone, like udev does.
Do you believe that he is being dishonest?
This wasn't said by some random Gentoo dev, it was the former eudev lead:Naib wrote:EXACTLY what happened with eudev, the reason it was created was twisted to be "oh its not needed anymore as systemd-udev supports musl" [...]
(source)blueness wrote:My original purpose for maintaining eudev was because systemd + musl did not play well together when udev was absorbed into the sytemd repo. Now thanks to patches from openembedded, they do, and my original reason for maintaining eudev is no longer valid. So its time to retire eudev. It has served its purpose as a stop-gap.(source)blueness wrote:> Are there any concerns about upstream one day making udev and systemd
> inseparable again?
I can't address this. There are two issues: 1) making sure there is a device manager for musl. 2) making sure there is a device manager which is independent of systemd. My concern was the former, hence eudev. If one day I have to use systemd on a musl system, so be it. If anyone is concerned about the second issue, they are welcome to maintain eudevMy life circumstances have changed and I don't have the time or will.
Do you believe that he is being dishonest?
The original news item was different and had to be recalled
https://archives.gentoo.org/gentoo-dev/ ... f7632e3ed6
That security issue had been around for well over a year and just sat there because the gentoo security team deemed it not as serious as it could have been. for the original news item to mark it for removal due to security concerns alone as is misleading
As mv said earlier, the problem is that:pingtoo wrote:I agree, this one of the over thinking engineerAnon-E-moose wrote:It seems from all I've read, that this was just a theoretical problem, ie it might happen in the futureto believe there is a security issue for opentmpfiles on Gentoo
However I accept the argument that the developer of opentmpfiles wish to stop development and therefor adapt systemd-tmpfiles
I was intrigued by this thread, so I follow all links that relevant to this topic and did some thinking. I believe opentmpfiles is sufficient for Gentoo usage.
Here is my reason,
- opentmpfiles on Gentoo usage is very different from how a systemd managed system. In a systemd managed system the *tmp files/directory* can happen in unpredictable manner because the dependency design.
In Gentoo, there are only three placeAll of three place require execute by root privilege. so if attacker can involve root privilege, the problem is not at opentmpfiles.
- sysinit service opentmpfiles-dev
- boot service opentmpfiles-setup
- A ebuild call restart service(s) or call tmpfiles directly
In Gentoo opentmpfiles only check three place for configuration filesAll these three places only root allow to write, All configuration file in those directories own by root and only root allow to change.
- /usr/lib/tmpfiles.d
- /run/tmpfiles.d
- /etc/tmpfiles.d
- The openrc/opentmpfile issue CVE-2017-18925 root privilege escalation by symlink attack Really does not apply to Gentoo system.
because if attacker can modify/create opentmpfiles configuration file as root, than the problem is at system user's privilege management, it is the not the tool.
you mean thissam_ wrote:That doesn't answer the eudev part. Anyway, as for opentmpfiles, bug 751415, had no reply in Gentoo or on the upstream bug tracker. Undisputed vulnerabilities with no response or fix upstream are generally candidates for masking or last-rites/removal. Someone making an error, there being an oversight, or nobody bothering to explain from an opentmpfiles perspective why something is fine is not being dishonest.Naib wrote:The dev team were being dishonest yes.GDH-gentoo wrote:The dev (and apparently also the rest of opentmpfiles' developers) didn't want to support it anymore because he believed that fixing the security issue was too much work (among other things):
(source)
Do you believe that he is being dishonest?
This wasn't said by some random Gentoo dev, it was the former eudev lead:
(source) (source)
Do you believe that he is being dishonest?
The original news item was different and had to be recalled
https://archives.gentoo.org/gentoo-dev/ ... f7632e3ed6
That security issue had been around for well over a year and just sat there because the gentoo security team deemed it not as serious as it could have been. for the original news item to mark it for removal due to security concerns alone as is misleading
(I could dig out the specific threat the Pottering made to Gentoo around this time but we all know it)(Yes, udev on non-systemd systems is in our eyes a dead end, in case you
haven't noticed it yet. I am looking forward to the day when we can drop
that support entirely.)
there you have it, it was warnedThat's just now. What other systemd-related restrictions/dependancies
will be eventually rammed down the throats of non-users of systemd?
eudev is a "declaration of independance" for non-systemd users.
Precisely to all of the above. Ditto for udev on the latter point.Hu wrote:To add on to sam_'s remark, while root privilege may be required to install a dangerous opentmpfiles configuration, that does not mean a dangerous file cannot happen on a system that is otherwise free of malicious privileged users. An upstream developer without malicious intent may, through simple negligence, write and ship a tmpfiles.d configuration that, when processed by opentmpfiles, would be a security problem. Regardless of whether the file is dangerous because of malice or negligence, it may well look reasonable enough that it could pass a simple code review, and only be recognized as a problem when audited by someone who is specifically considering all the edge cases that an attacker might try to apply to it. In the general case, a security review must assume that every security property not guaranteed by the program under test will fail in the attacker's favor. In this situation, that would mean that an unprivileged user might have a full Linux shell running concurrent to the opentmpfiles code processing the bad configuration file. With full shell access, the attacker can make any system calls necessary to try to trip opentmpfiles bugs associated with race conditions.
Obtaining a quality code review is famously hard. Shipping a tool that enables upstream to quickly write something that both serves its intended purpose, and also is a subtle security vulnerability, is a risky proposition. Given that the code lifted from systemd serves the same purpose and makes it harder for upstream to negligently introduce security problems, using that seems like the wiser choice. As with all things open source, if systemd upstream tomorrow committed code that broke the ability to use systemd-tmpfiles on an openrc system, Gentoo would not be powerless to deal with it. The Gentoo developers could ship a derivative that reverts that bad commit, or fork at the last known good one.
Oh, cool.CVE-2017-18925 root privilege escalation by symlink attack wrote: The first time that opentmpfiles-setup is run, things are fine; but then suppose I replace "foo" with a symlink:
$ rm -r /var/lib/opentmpfiles-exploit-symlink/foo
$ ln -s /etc/passwd /var/lib/opentmpfiles-exploit-symlink/foo
and restart the service...
$ sudo /etc/init.d/opentmpfiles-setup restart * WARNING: you are stopping a boot service
* Setting up tmpfiles.d entries ...
mkdir: cannot create directory ‘/var/lib/opentmpfiles-exploit-symlink/foo’: File exists
The call to chown has followed my symlink, and given me ownership of /etc/passwd
Fair point, security is difficult to get right, but the suggested solution is an attempt to create a technical patch ('procedure') for a social issue ('incompetence').a security review must assume that every security property not guaranteed by the program under test will fail in the attacker's favor. In this situation, that would mean that an unprivileged user might have a full Linux shell running concurrent to the opentmpfiles code processing the bad configuration file. With full shell access, the attacker can make any system calls necessary to try to trip opentmpfiles bugs associated with race conditions.

Code: Select all
$ sudo ...I am sorry, but I disagree with you about this,sam_ wrote:As mv said earlier, the problem is that:pingtoo wrote:I agree, this one of the over thinking engineerAnon-E-moose wrote:It seems from all I've read, that this was just a theoretical problem, ie it might happen in the futureto believe there is a security issue for opentmpfiles on Gentoo
However I accept the argument that the developer of opentmpfiles wish to stop development and therefor adapt systemd-tmpfiles
I was intrigued by this thread, so I follow all links that relevant to this topic and did some thinking. I believe opentmpfiles is sufficient for Gentoo usage.
Here is my reason,
- opentmpfiles on Gentoo usage is very different from how a systemd managed system. In a systemd managed system the *tmp files/directory* can happen in unpredictable manner because the dependency design.
In Gentoo, there are only three placeAll of three place require execute by root privilege. so if attacker can involve root privilege, the problem is not at opentmpfiles.
- sysinit service opentmpfiles-dev
- boot service opentmpfiles-setup
- A ebuild call restart service(s) or call tmpfiles directly
In Gentoo opentmpfiles only check three place for configuration filesAll these three places only root allow to write, All configuration file in those directories own by root and only root allow to change.
- /usr/lib/tmpfiles.d
- /run/tmpfiles.d
- /etc/tmpfiles.d
- The openrc/opentmpfile issue CVE-2017-18925 root privilege escalation by symlink attack Really does not apply to Gentoo system.
because if attacker can modify/create opentmpfiles configuration file as root, than the problem is at system user's privilege management, it is the not the tool.Also, it being run as root doesn't really absolve anything. This is back to "it's better to make it easier to write a safe init script".
- upstreams may provide their own tmpfiles configuration which works safely with systemd's implementation, yet doesn't with opentmpfiles
- it's unrealistic and unsustainable for everybody to have to audit both every file from upstream for compatibility and security with opentmpfiles
- if opentmpfiles has footguns that systemd's tmpfiles does not, it's introducing the problems that tmpfiles was trying to solve (avoiding footguns in init scripts by doing things at startup in a standard way)
This is the ebuild developer's decision. Should the ebuild developer choose to make it only compatible with systemd's implementation she/he can mark so in USE flag. How ever Gentoo is to give freedom of choose to it's user, it should not be force on to user under security context.upstreams may provide their own tmpfiles configuration which works safely with systemd's implementation, yet doesn't with opentmpfiles
It is not *everyone* it is the ebuild developer I generally hope that Gentoo ebuild developer always aware of security context so they review the configuration requirement from upstreams before it is marked as stable.it's unrealistic and unsustainable for everybody to have to audit both every file from upstream for compatibility and security with opentmpfiles
But this is where we see things different, I believe opentmpfiles does not have the *footguns* you stated under Gentoo's usage, I am not saying the opentmpfiles does not have flaw that stated by the CVE, I am saying the flaw will not happen during the normal Gentoo OpenRC designed usage pattern.if opentmpfiles has footguns that systemd's tmpfiles does not, it's introducing the problems that tmpfiles was trying to solve (avoiding footguns in init scripts by doing things at startup in a standard way)