News for hackers. Stuff that matters.
Re:The Insecurity Industry by MichaelMoser123 on Tuesday July 27, 2021 @01:48AM (#27969045)
Where is your legislation supposed to draw the line? In Rust you need to have occasional unsafe code - you can't even have a double linked list or bidirectional graph without unsafe code. Would you also outlaw jni calls in java?
Re:The Insecurity Industry by staticassertion on Tuesday July 27, 2021 @02:24AM (#27969259)
The way this would likely end up being handled is the same as any other compliance.

You define the threat model for your application and then justify why you're safe. In this case we'd be adding an explicit point to ensure that there are controls for attackers who can exploit memory safety issues.

You could end up with controls like:

1. We sandbox our code, so even though it's C we feel that we're safe

2. We use a memory safe language to reduce the risk of memory safety issues

3. We sanitizer inputs before providing them to the program

etc etc

What ends up being accepted as legitimate would be up to the auditors/ generally a matter of consensus.

Re:The Insecurity Industry by MichaelMoser123 on Tuesday July 27, 2021 @09:16AM (#27972024)
would that imply that the state would have to review the design and implementation of every system under their jurisdiction? I think that would be a bit heavy for everyone involved.
Re:The Insecurity Industry by staticassertion on Tuesday July 27, 2021 @10:56AM (#27973215)
This is already the case.
Re:The Insecurity Industry by FractalHQ on Tuesday July 27, 2021 @02:26AM (#27969271)
Can’t unsafe Rust (when properly isolated) exist within a larger codebase that, as a whole, can still be considered safe?
Re:The Insecurity Industry by lionkor on Tuesday July 27, 2021 @04:02AM (#27969827)
The same way you can write safe modern C++ and only use unsafe features of the language when its necessary and isolated, but thats also considered unsafe, so Rust should be, too
Re:The Insecurity Industry by pjmlp on Tuesday July 27, 2021 @04:27AM (#27969988)
My experience with trying that in Visual C++, alongside the C++ Core Guidelines and "borrow checker" static analysers, is that there is what we wish to happen, and how the code actually looks like in reality.
Re:The Insecurity Industry by lionkor on Tuesday July 27, 2021 @05:27AM (#27970388)
I find that, if you enable all warnings, most as errors, and use clang-tidy and cppcheck, you end up with an incredibly powerful safe language. Now, combine that with some good patterns and avoidance of NIH syndrome, and you can get very far while keeping the huge amount of control and libraries that C++ gives.

Edit: And, of course, a lot of forced static typing and avoiding global scoped stuff. So, for example, you'd make a

    struct Meter {
        float value { 0.0f };
    };
    Meter wall_length;
instead of `float wall_length; // meters`.
Re:The Insecurity Industry by pjmlp on Tuesday July 27, 2021 @05:56AM (#27970573)
Even if we constrain ourselves to clang-tidy and cppcheck, and the platforms where they are supported, you can only assert that to your own code, and eventually third party libraries in source code.

Then even if you find issues in those third party code libraries, there is the issue of if you are allowed to change them yourself, or how those fixes get provided by the library vendor, warranties and so on.