Live data from Hacker News

The Linux backdoor attempt of 2003 (2013)

freedom-to-tinker.com

51–60 of 105 posts

Re: The Linux backdoor attempt of 2003 (2013)

#51
it still seems kinda weird to me that all it takes to elevate privileges for a user process to "can arbitrarily write system level memory or disk" is just the clearing of all the bits of a single integer in kernel space which can be done by pretty much any execution path in the kernel.

it just seems like there could be a more tamper resistant mechanism around privilege elevations.

Re: The Linux backdoor attempt of 2003 (2013)

#52
post #3

I have the full story on that incident. It is actually really funny. If the guy who did it wants to come forward, that is his decision. [edit: I won't name names.] He did provided me the full story. He told me with the understanding that the story would go public, so I will dig it up and post it. I also interviewed the sysadmins who were running the box at the time. 1. it was not an NSA operation, it was done by a ha…

Did not cliph / wojciech purczynski also try to backdoor the kernel?

Re: The Linux backdoor attempt of 2003 (2013)

#54
post #29

Another bit of cleverness not mentioned in the article is that assignment expressions always evaluate to the rvalue. So the expression `current->uid = 0` has the effect of making sure that entire conditional never actually runs (or at least, the return never runs), which means the overall behavior of wait4 doesn't change in an observable way. Very clever if you're trying to pass all of the existing tests

But that should be something the compiler could catch. The expression is always false and the condition would never be executed. You usually get a warning for that. And if the compiler doesn't, linters do. This is a common mistake, and I believe most linters have rules for that. And I don't think there is any situation where there is a good reason for code like this to exist. Either the expression is wrong, or it doe…

> But that should be something the compiler could catch.

Today, certainly. My compiler even catches errors in the format strings to printf[1].

But back then? I doubt it, even with all the warnings turned up.

[1] Removing yet another common source of bugs.

Re: The Linux backdoor attempt of 2003 (2013)

#55
post #36

I'm pretty sure there are tons on unreleased and unpublished backdoor exploits for linux and windows likewise. The problem is you can't fix them yourself if the signature keeps unknown to anyone.

“Backdoor” means something deliberately and specifically added to enable the vulnerability. I.e., something can't really be both a backdoor and an exploit.

Really? I think of a backdoor as a deliberate vulnerability, and the exploit as the attack (or attack code) that makes use of any kind of vulnerability.

Let's say the NSA adds a backdoor. If someone else finds it, isn't that an exploit?

Re: The Linux backdoor attempt of 2003 (2013)

#56
post #2

Previous discussions - [1] [2] [1] https://news.ycombinator.com/item?id=24106213 [2] https://news.ycombinator.com/item?id=18173173

Thanks! Macroexpanded:

The Linux Backdoor Attempt of 2003 (2013) - https://news.ycombinator.com/item?id=24106213 - Aug 2020 (141 comments)

The Linux Backdoor Attempt of 2003 - https://news.ycombinator.com/item?id=18173173 - Oct 2018 (28 comments)

The Linux Backdoor Attempt of 2003 - https://news.ycombinator.com/item?id=6520678 - Oct 2013 (63 comments)

Re: The Linux backdoor attempt of 2003 (2013)

#57

> it said "= 0" rather than "== 0" Why do so many programming languages have different equals/assigns operators? There are languages that combine them and apparently don't have any problems. Is it something to do with being strongly vs. weakly typed?

I don’t think strong/weak typing is the culprit here. I think partly that being explicit is nice. Assignment and equality are two very different things, so it makes sense for there to be different syntax. You can easily prevent the code in the article from working—just disallow assignment inside of expressions. This is probably a good idea, and a lot of newer languages make that choice. Even when you read papers abou…

> I would hate to see something like this in my code base:

> a = x = y;

> If that meant “set ‘a’ to true if ‘x’ is equal to ‘y’, and false otherwise.” I would, honestly, be a little pissed off.

Would you find it more acceptable as `a = (x = y)`? To me, that is reasonably clear.

Re: The Linux backdoor attempt of 2003 (2013)

#58
post #57

Earlier quoted context omitted.

I don’t think strong/weak typing is the culprit here. I think partly that being explicit is nice. Assignment and equality are two very different things, so it makes sense for there to be different syntax. You can easily prevent the code in the article from working—just disallow assignment inside of expressions. This is probably a good idea, and a lot of newer languages make that choice. Even when you read papers abou…

> I would hate to see something like this in my code base: > a = x = y; > If that meant “set ‘a’ to true if ‘x’ is equal to ‘y’, and false otherwise.” I would, honestly, be a little pissed off. Would you find it more acceptable as `a = (x = y)`? To me, that is reasonably clear.

> Would you find it more acceptable as `a = (x = y)`? To me, that is reasonably clear.

No, I don’t consider that acceptable. It is not enough that it is clear to some people who know what they are looking at. The language should be more clear to more people.

Re: The Linux backdoor attempt of 2003 (2013)

#59
post #48

> it said "= 0" rather than "== 0" Why do so many programming languages have different equals/assigns operators? There are languages that combine them and apparently don't have any problems. Is it something to do with being strongly vs. weakly typed?

Some to make them more distinct. Some because they treat assignment as an expression, and so either can occur in the same context. In the former you could combine them. In the latter you can't (you need to be able to tell if "if (a = b) ..." contains a comparison or assignment). (EDIT: I agree with the sibling reply from klodolph there - there are many cases where reusing the same operator would get really confusing,…

It's been my impression over the years that = vs. == is one of the most common mistakes made in languages that use them. In which case, can it really be said to be less confusing?

Re: The Linux backdoor attempt of 2003 (2013)

#60
post #48

Earlier quoted context omitted.

Some to make them more distinct. Some because they treat assignment as an expression, and so either can occur in the same context. In the former you could combine them. In the latter you can't (you need to be able to tell if "if (a = b) ..." contains a comparison or assignment). (EDIT: I agree with the sibling reply from klodolph there - there are many cases where reusing the same operator would get really confusing,…

It's been my impression over the years that = vs. == is one of the most common mistakes made in languages that use them. In which case, can it really be said to be less confusing?

Modern languages using that syntax tend to prevent that mistake by either outright disallowing assignments in boolean contexts, or by not having implicit conversion of other types to boolean, meaning that the mistake would be limited to the case of comparing a boolean variable to another value, which is quite rare. Some languages further limit the risk by making variables unmodifiable by default, meaning that it would have to be an explicitly modifiable boolean variable.

Assignment is one of the most frequent operations in typical programming languages, so it makes sense for it to be a single-character symbol, and ‘=’ is about the only fitting ASCII symbol for that. (With non-ASCII, there would be ‘≔’ or ‘←’ (the latter being used by APL), but those are non-obvious to type.)

Post reply on HN