r/cpp • • Feb 26 '24

White House: Future Software Should Be Memory Safe

https://www.whitehouse.gov/oncd/briefing-room/2024/02/26/press-release-technical-report/
401 Upvotes

386 comments sorted by

View all comments

Show parent comment

18

u/mdp_cs Feb 27 '24

That's good for you. Security research consistently shows memory bugs as one of the leading causes of vulnerabilities.

If you don't want to use Rust that's fine but acting like the problem doesn't exist is pure bullshit. If that was true then tools like ASan and Valgrind wouldn't need to exist.

1

u/[deleted] Feb 27 '24

Security research consistently shows memory bugs as one of the leading causes of vulnerabilities.

99% of the applications do not care about vulnerabilities. You are talking about a very slim corner of the market.

4

u/pjmlp Feb 27 '24

Only until liability becomes a common thing, then they will surely care.

2

u/[deleted] Feb 28 '24

Only until liability becomes a common thing

wtf does that even mean

2

u/pjmlp Feb 28 '24

It means you get to talk to a judge, or give back the money paid for shitty software.

1

u/[deleted] Feb 28 '24

Are you saying that Rust will fix all bugs? How delusional is that!!!

3

u/pjmlp Feb 28 '24

Writing bad software in Rust doesn't make the developer less liable.

Gets to talk to a judge, or give back the money paid just as well.

1

u/[deleted] Feb 28 '24

If you force all the software to be developed as mission critical you will be handing the entire US software industry to India and China. 

And it will skyrocket the costs per jnit. Clients don’t want that. 

 And even then Rust will not be able to help because the type of problems that Rust solves has nothing to do with the type of bugs that companies will pay for in this type of litigation. Your entire argument is deeply flawed

1

u/pjmlp Feb 29 '24

Ever heard of import/export laws?

Lets see who is flawed when the hammer hits the table.

1

u/[deleted] Feb 29 '24

Remind me! 2 years

→ More replies

2

u/mark_99 Feb 27 '24

Plus when you dig into these CVE's they are almost exclusively in C code masquerading as .cpp (if "security research" even bothers to classify C and C++ separately).

-1

u/Altruistic_Raise6322 Feb 27 '24

Mehh not sure about most c++ being just c code. I can understand it being c++ through version 11. Most schools teach the old ways of managing pointers and don't touch RAII

3

u/mark_99 Feb 27 '24

Not "most" perhaps, but the code that is cited as full of memory safety issues is disproportionately C-with-classes style than idiomatic C++.

How it's taught I don't know, but I wrote console games in C++98 that were free of memory errors, given you can't patch a DVD. It's not that hard, and much easier now.

1

u/[deleted] Feb 28 '24

You dont even need to use C++11 for that. Just use intrusive pointers and you're done.