Live data from Hacker News

Xz: Can you spot the single character that disabled Linux landlock?

git.tukaani.org

131–140 of 322 posts

Re: Xz: Can you spot the single character that disabled Linux landlock?

#131
post #119

Earlier quoted context omitted.

Even more evil would have been to replace this line (void)SYS_landlock_create_ruleset; with this: (void)SYS_landloсk_create_ruleset;

For those squinting, the "landlock" regular "c" is replaced with a Cyrillic U+0441.

Is there a GCC option to error on non-standard English characters?

Re: Xz: Can you spot the single character that disabled Linux landlock?

#132

Earlier quoted context omitted.

Ok there's a larger question here about the bazaar software development method. How can we ensure say, that Microsoft doesn't pay someone to throw a wrench in libre office development or Adobe to sabotage Gimp? There's lots of deception strategies for bad faith actors and given the paucity of people who actually do the work, it's really really hard to be picky. Especially with the complexity of library dependencies.…

>How can we ensure say, that Microsoft doesn't pay someone to throw a wrench in libre office development or Adobe to sabotage Gimp? Microsoft and Adobe have reputations to uphold long into the future. Is that infallible? Hell no it isn't, but consider that Jia Tan only needed to uphold his reputation insofar as getting his backdoor onto everyone's systems. Once that is done, his reputation or the lack thereof becomes…

Those companies are famous for skullduggery.

They can secure the dominance of their offering against the open source competition for well under 500k a year. It's a no brainer.

What this might look like would be say, poorly discernable icons, clumsy UI design, or an unstable API that makes plugins constantly break. Large volumes of documentation that are inadequate or inaccurate in critical places, etc.

If I was malicious I'd pay someone to write otherwise functional code and bug fixes but make really user hostile decisions whenever possible.

We should be diligent for this in a few key projects. Tech companies could easily be doing this already.

Re: Xz: Can you spot the single character that disabled Linux landlock?

#133

Earlier quoted context omitted.

Even more evil would have been to replace this line (void)SYS_landlock_create_ruleset; with this: (void)SYS_landloсk_create_ruleset;

compiler would perhaps "see" it ?

Sure; but so long as the compiler error is silently discarded (as it is here), the configure script will assume landlock isn't available and never use it.

Re: Xz: Can you spot the single character that disabled Linux landlock?

#134
post #55

Would it be reasonable to expect that this MR comes along with a test that shows that it does the thing it’s claiming to do? I’m not sure how that would work in this case.. have a test that is run on a system that is known to have landlock that does something to ensure that it’s enabled? Even that could be subverted, but it seems like demanding that kind of thing before merging “features” is a good step.

I like the idea of testing build-system behaviors like this, and I don’t think it’s ever really done in practice. Scriptable build systems, for lack of a better name for them, exist at a bad intersection of Turing complete, hard to test different cases, hard to reason about, hard to read the build script code, and most of us treating them as “ugh I hope all this stuff works” and if it does “thank god I get to ignore…

If you mean testing the "disable Landlock if the headers and syscalls are out of sync" functionality then I agree, workarounds for such corner cases are often not fully tested.

But it would have been enough here to have a test just to see that Landlock works in general. That test would have broken with this commit, because that's what the commit actually does - break all Landlock support.

Based on that it sounds like there wasn't a test for Landlock integration, if I've understood things correctly.

Re: Xz: Can you spot the single character that disabled Linux landlock?

#135

I can't believe that system security is dependent on such a loose chain of correctness. Any number of things could have stopped this. + # A compile check is done here because some systems have + # linux/landlock.h, but do not have the syscalls defined + # in order to actually use Linux Landlock. Fix those headers on those systems to explicitly opt-out. What's the point of headers if they don't declare their capabilit…

You are quoting Jia Tan [1]. The malicious actor wrote that comment when deliberately breaking the check in the first place. Fixing headers or extra tests would not have prevented this, as there is no indication the headers were broken in the first place, and extra tests could have been compromised (or ignored for release tarball) some other way. [1] https://git.tukaani.org/?p=xz.git;a=commit;h=328c52da8a2bbb8...

Should the better fix then to have been to revert the bad commit with the malicious commit message, rather than just deleting the dot (as was done)?

Re: Xz: Can you spot the single character that disabled Linux landlock?

#136
post #119

Earlier quoted context omitted.

For those squinting, the "landlock" regular "c" is replaced with a Cyrillic U+0441.

Is there a GCC option to error on non-standard English characters?

Disclosure: I've got zero C/C++ on my resume. I was asked to diagnose a kernel panic and backport kernel security patches once, but it was very uncomfortable. ("Hey, Terr knows the build system, that's close enough, right?")

That said, perhaps something like disabling the default -fextended-identifiers [0], and enabling the -Wbidi-chars [1] warning.

[0] https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html...

[1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#inde...

Re: Xz: Can you spot the single character that disabled Linux landlock?

#137
post #67

Earlier quoted context omitted.

I don’t know. In my code I’d always compile and check at runtime?

Not everything is detectable at runtime, such as syscall numbers (which is what's being tested for here).

Runtime syscall number detection is very common in practice, since the kernel returns ENOSYS to enable that exact ability for glibc and other shim libraries

Re: Xz: Can you spot the single character that disabled Linux landlock?

#138

On an unrelated note, this malware team has assembled a great dataset for training AIs on identifying security problems. Every commit has some security problem, and the open source community will be going through and identifying them. (Thanks, maintainers, for the cleanup work; definitely not fun!)

I hear this stuff for the first time, can you post some info about that?

Re: Xz: Can you spot the single character that disabled Linux landlock?

#139

Earlier quoted context omitted.

He had unfettered access to xz’s git?

Isn’t it a bit ironic with how much code everyone depends on that can freely be altered by some unknown party, while so much time goes into code reviews to verify internal changes at most companies.

Some might say RMS was right all along.

Re: Xz: Can you spot the single character that disabled Linux landlock?

#140
post #7

Earlier quoted context omitted.

So that function checked if the following C code compiled, and only in that situation enabled the landlock? Except that lone period, hard to recognize because of its small size and proximity to the left edge of the diff, caused the C code to become always invalid, hence keeping the landlock always disabled? That's both vilely impressive and impressively vile. I didn't even spot it on my first read-through.

Even more evil would have been to replace this line (void)SYS_landlock_create_ruleset; with this: (void)SYS_landloсk_create_ruleset;

Putting random Unicode confusables in source code would be far easier to consider malicious
Post reply on HN