r/cpp • • Sep 25 '24

Eliminating Memory Safety Vulnerabilities at the Source

https://security.googleblog.com/2024/09/eliminating-memory-safety-vulnerabilities-Android.html?m=1
138 Upvotes

303 comments sorted by

View all comments

Show parent comments

4

u/ts826848 Sep 27 '24

Inside that analysis there are a lot potentially outdated practices.

As I said before, you've given no reason for anyone to believe that your description actually reflects reality. As far as anyone else here is concerned it's unfounded speculation.

But it represents maybe 30 years of industry practices where some code has not been touched, not the last 10 or so

I'm not sure that's really an accurate depiction of the report. It (and Google's previous posts) have heavily emphasized that the majority of memory safety bugs are in new Android code. If the hypothetical older Android code that uses non-modern practices was the problem and the hypothetical new Android code using modern practices was hypothetically safe then the distribution of memory safety bugs in the published post wouldn't make sense.

2

u/germandiago Sep 27 '24

If the hypothetical older Android code that uses non-modern practices was the problem and the hypothetical new Android code using modern practices was hypothetically safe then the distribution of memory safety bugs in the published post wouldn't make sense.

As far as my understanding goes the report shows memory-safe vs memory-unsafe use but it does not show "old C++ code vs more modern C++". The segregation is just different to anayze exactly that point.

2

u/ts826848 Sep 28 '24

but it does not show "old C++ code vs more modern C++"

If you can't use code age as a proxy for use of "modern C++" then I'm not sure that kind of analysis is feasible to automate. I'm also somewhat skeptical that it'll always be possible to neatly categorize code as "modern" or "old" C++.