by pdimitar · 2y ago · 0 comments
When will we learn?
You hate Rust -- fine (not fine but OK, I guess people get super triggered over it and it's a reality I can't change but I am still baffled by it because they throw away reason for emotions and these people should really know better). Fine. Just use Golang or any other GC language really (Java or C# as well, if you must).
When will we abandon convenient routine and start adapting to modern realities? ("Modern" being at least 25-year old here but hey, I am willing to give you some leeway and not roast you too much. Let's assume these are "modern" realities, f.ex. just the last 5 years.)
Ok, but seriously I don't believe this will ever happen and I don't really think this is a language debate nor do I want to engage in one.
This is about putting critical infrastructure connected to the internet that's running an operating system that you can't trust out of the box. Since the Windows OS is susceptible to so much malware you need all these third party services (which you also can't trust or audit, but it's absolutely better than not having anything) on top of the OS.
There was a whole host of companies that had zero problems, not because they're using Rust, but because they have much better security practices and quality infosec employees.
Agreed, they should not be using Windows in the first place. That should have been the first line of defense.
> There was a whole host of companies that had zero problems, not because they're using Rust, but because they have much better security practices and quality infosec employees.
Fair enough, I only commented on one layer of the security stack -- so your remark that expands the scope is valid and welcome.
> We're all waiting for your anti-malware Rust Win32 kernel module...
I am done working for free. If I am paid to do it I am sure I would have done better than this poor confused soul who allows NULL pointer dereferencing which is a mistake that most C/C++ interns quickly learn to avoid.
Crowdstrike borked RHEL 1 month ago https://access.redhat.com/solutions/7068083 Literally the same situation, unbootable machines.
The reality is that shitty software broke everything. Why do we have to drag the OS into this?
The root issue is giving privileged access to a business entity you think you can trust, but clearly can't.
I'm a fulltime Rust developer, but I don't think Rust saves you here.
E.g. loading it would require you to setup a maximal size and a valid configuration struct?
We haven't seen the code but it could be something like:
char *ptr = parsefile(file_we_released_without_testing);
if(ptr[0]=='A') { } // BSOD loop
parsefile returns NULL unexpectedly.So this style of error can be addressed by using a safe language. Or static analysis. Or code reviews. Or not doing this stuff in the kernel. Or formal methods. Or fuzzing.
As someone else said you likely can't easily use Rust for Windows kernel modules/drivers. I'm sure a strong enough engineering team could do it (e.g. transpile Rust to C) but I'm not sure it's the biggest engineering problem CrowdStrike has. Microsoft has a complete tool-chain for developing these and it's usually C/C++ or assembly.
I mean that the least you can do before pointer dereference is just check for several bad sentinel values, NULL being one of them.
Seems like a rather amateur mistake to me.
I have to imagine that this bug has existed for quite some time and I’d be curious to know what other input validation errors they have, considering the amount of untrusted input they evaluate at ring 0 originating from userland.
At the very least, big money security software companies should be parsing untrusted content with some kind of rigorouly safe approach, not just squirting it through a big pile of C/C++.
And don't get me started on the whole concept of undefined behavior in those languages. To quote I. I. Rabi, "Who ordered that?"
the malformed files were updates from crowdstrike itself. It's not exactly "untrusted content".
I'd love to hear from an engineer on the project but unfortunately we're likely not to.
But I am in full agreement with you that sloppy programmers cannot truly be helped. They just screw up and move on like nothing happened. Sigh.
BTW, using your metaphor, until 2 days ago they didn't even know that there was a fire in the basement, nor a basement.
C++ was a terrible, terrible mistake.
To screw up so legendarily requires a concert of bad decisions.
2. If the driver crashed due to a Rust panic, the result (boot loop) would be the same.
It's good to criticize the current state of things, but don't pretend you have a solution.
Also, do we know if rust would have helped here? Rust doesn't guarantee no crashes -- in fact, panicking (aka crashing) is the default.
RE: panic default, don't get fooled by hobby projects, professional Rust code always does pattern matching and does not defer to panics.
The "software that doesn't exist" point is somewhat valid, though it's also the chicken and the egg problem, as in that not many people are working to make it happen because the current state of affairs is wrongly deemed as good enough. And it really is not.
That's a "programmers who know what they're doing don't make that mistake" argument. If that were tenable there'd be no need for rust in the first place.
But this is easier to scan for compared to all the potential memory unsafeties in C/C++. It's an improvement.
Doing the same with zero control over the non-Rust side of the kernel seems completely untenable.
Not saying you can't write bugs in Rust, of course -- that would be crazily delusional. I am saying they needed a better process. And I am saying that a stricter language could have improved the process a bit as well.