Starting with the direct question first...
Is there any known issue with installer which could lead to bundle being corrupted this way? Did anyone faced anything similar?
No, I haven't heard of anything like this and what you're describing here is extremely weird:
I'm facing a weird issue when application bundle is corrupted during installation. The corruption always look the same - a certain sequence of bytes is erased (zeroed) in the file at multiple places, which obviously breaks the bundle signature.
By definition, the kind of corruption your describing can only be caused by a few different case:
- The bytes in the original data source were "wrong" from the start.
That's obviously worth verifying, but (presumably) you've already ruled that out.
- The installer wrote the data out wrong.
It's difficult to see how/why this would happen. The installer basically only has one job ("Go Forth and Write Files") and it's hard to see how/why it would screw up that badly. More cynically, it's used so broadly that it's unlikely to have "small" mistakes.
- Something in the system corrupted the data.
This is very difficult to rule out, but it's hard to see what component would/could have done something like this. The system is generally pretty good about only opening for "write" when it actually needs to write, which means that much of the system couldn't make the kind of modification you're describing. It did look at "gktool" and all it actually does is use XPC to trigger exactly the same scan process you see in the broader system. It never actually opens any file (syspolicyd is what's actually doing all the work) and most of it's implementation is actually about turning error codes from syspolicyd into error messages.
- "Something else is going on".
This is the generic "catch-all" which covers all the unknowns but, in a case like this, it almost always involves some kind of 3rd party component/configuration/issue. You pointed to one obvious possibility, but even that raises odd questions:
I was suspecting a deployment tool or "security software" but I've seen the issue for manually installed packages too.
Security software using EndpointSecurity (and it's predecessor, "kauth") have a long history of causing all kinds of strange failures, as the power to "veto" all of the most critical system calls is obviously quite powerful and dangerous. However, I don't see how an ES client would/could do something like this:
'
a certain sequence of bytes is erased (zeroed) in the file at multiple places
The issue here is that, because of how the I/O and VM systems are integrated, "writes" aren't something an ES client can actually block or interact with. That is, an ES client can control access by blocking "open", but if they allow the file to be opened they can't later block individual "write" calls.
A few questions I'd be looking at:
-
What were the actual modifications that occurred and what files did they occur on? You said that specific bytes were modified but what was actually changed?
-
Related to that point, how do you "know what you know" and are you sure you understand what actually happened? Having a whole "file" become zero'd is VERY different than specific bytes changing inside an otherwise intact file, so it's important to make sure you're sure about what's actually happening.
-
What other information have you gathered? What makes an issue like this appear "random" is almost always one (or more) "differences", which are what actually create the failure. Finding those differences will at least let you reproduce the issue, assuming they don't directly get you to the failure.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware