|
|
Subscribe / Log in / New account

Defining the Rust 2024 edition

Defining the Rust 2024 edition

Posted Feb 3, 2024 1:16 UTC (Sat) by jschrod (subscriber, #1646)
In reply to: Defining the Rust 2024 edition by mb
Parent article: Defining the Rust 2024 edition

Ah, Rust code has by definition no security problems.

This is not worthy to discuss.

*plonk*


to post comments

Defining the Rust 2024 edition

Posted Feb 3, 2024 9:36 UTC (Sat) by mb (subscriber, #50428) [Link]

>Ah, Rust code has by definition no security problems.

Really? Nobody said that in this whole discussion.
I said that this particular CVE would probably not have existed, if the function was written in Rust.
Look at it!
It is a classical buffer overflow. Buffer overflows and integer overflows resulting in buffer overflows are *the* most common thing when it comes to security problems.
This bug would almost certainly not have been exploitable in Rust.
It would have been garbage data in -> garbage out (program termination).

But you know what? You are actually right.
Rust code can also have security problems, of course.
Rust only tries to make certain classes of bugs impossible or much much harder to express.

But it is no coincidence that these classes of bugs make the majority of security bugs.

And that is what makes Rust code have *almost* no security problems by definition.
Of course you can still incorrectly implement your security checks for your door entry mechanism. But Rust ensures that it won't outright blow up right into your face with UB.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds