Live data from Hacker News

Am I a Good C Programmer?

gavinhoward.com

31–39 of 39 posts

Re: Am I a Good C Programmer?

#31

Earlier quoted context omitted.

Hospitals in at least 4 states diverting patients from emergency rooms after ransomware attack - https://www.usatoday.com/story/news/nation/2023/11/28/ardent... Moreover, it is untenable to maintain a small island of "secure software" for "important things" in a vast ocean of careless and vulnerable code. Inevitably, the island gets infected, and not even air-gaps can save it, as stuxnet showed.

> Moreover, it is untenable to maintain a small island of "secure software" for "important things" in a vast ocean of careless and vulnerable code. Inevitably, the island gets infected, and not even air-gaps can save it, as stuxnet showed. Why is it inevitable? As long as it doesn't connect to other software (via internet or other means), isn't it possible to formally verify one critical software component, e.g. in p…

more than that, you only have so much time and money, concentrating on more important pieces allows you to be more thorough where the highest impacts are.

perfect is the enemy of good, "security" people act as if all breaches are equally relevant.

When your surface area is everything you're more likely to have holes, that's just a law of nature. Limit your surface area and suddenly you can be more thorough.

Re: Am I a Good C Programmer?

#32
There's an interesting question raised by the linked "rant": should updating copyright year serve as a sign of life for a project?

I'm currently inclined to think that:

1. Yes, it should

2. The OP of the linked issue may be mistaking a tools / social conventions issue for an error by the author

Re: Am I a Good C Programmer?

#33

This is an interesting article! I think more of this kind of bug-type/origin-breakdown is a good thing to have. This and the Curl article make me wonder what factors impact the proportion of security bugs which are memory safety bugs. The most obvious variable is codebase size - Microsoft/Chromium both are huge codebases, with multiple millions (billions?) of lines of code each. Curl appears to clock in closer to 100…

Author here. Thank you. :) One thing I am going to do in my new project is catalog all bugs fixed after first release with the following data points: * Is it a C bug? * Is it in a stable module of the monorepo? (I will mark things stable after they have been tested.) * Is the bug in a release, even if it's in an unstable module? * Is it a build bug? * Is it a test bug? * Etc. I'll keep the catalog in a human- and mac…

Do you have an interface in mind to reduce friction for building the catalog on a daily basis? GitHub and Gitea don't really seem to provide clean ways to do this out of the box.

Re: Am I a Good C Programmer?

#34

Earlier quoted context omitted.

Hospitals in at least 4 states diverting patients from emergency rooms after ransomware attack - https://www.usatoday.com/story/news/nation/2023/11/28/ardent... Moreover, it is untenable to maintain a small island of "secure software" for "important things" in a vast ocean of careless and vulnerable code. Inevitably, the island gets infected, and not even air-gaps can save it, as stuxnet showed.

> Moreover, it is untenable to maintain a small island of "secure software" for "important things" in a vast ocean of careless and vulnerable code. Inevitably, the island gets infected, and not even air-gaps can save it, as stuxnet showed. Why is it inevitable? As long as it doesn't connect to other software (via internet or other means), isn't it possible to formally verify one critical software component, e.g. in p…

Formally verifying does no good if the compiler is infected. In the stuxnet example, formal verification wouldn't even help - how do you formally verify centrifuge timings?

Unlike what your sibling comment claims, I'm not saying all software is equally important, or must have equal effort invested in securing it. But insecurity absolutely is infectious, and the more insecure the general environment is, the harder it is to secure a small part of it.

For example, you'll want a compiler. How secure is the web stack of the page that delivers your gcc/clang? How secure is its host's infrastructure, and of the DNS provider? The browser you're downloading it with? Did you ever visit any other page that might have compromised it? What about your text editor, your OS, the SDK you're using to flash code onto the pacemaker.. And all of them have vast supply-chain networks.

Re: Am I a Good C Programmer?

#35

Earlier quoted context omitted.

> Moreover, it is untenable to maintain a small island of "secure software" for "important things" in a vast ocean of careless and vulnerable code. Inevitably, the island gets infected, and not even air-gaps can save it, as stuxnet showed. Why is it inevitable? As long as it doesn't connect to other software (via internet or other means), isn't it possible to formally verify one critical software component, e.g. in p…

Formally verifying does no good if the compiler is infected. In the stuxnet example, formal verification wouldn't even help - how do you formally verify centrifuge timings? Unlike what your sibling comment claims, I'm not saying all software is equally important, or must have equal effort invested in securing it. But insecurity absolutely is infectious, and the more insecure the general environment is, the harder it…

Hopefully, for the pacemaker, the authors of the code would be using a verified compiler like CompCert (although it's only verified for the compilation, not the parsing or the preprocessor), but you don't have control at every level, like for the hardware. You can't verify centrifuge timings, but you can specify software and verify that it fits the specification to the point that it won't be the point of failure (assuming you have everything under control, like the pacemaker SDK, everything). I do see what you're saying about it being infectious, though.

Re: Am I a Good C Programmer?

#36
post #33

Earlier quoted context omitted.

Author here. Thank you. :) One thing I am going to do in my new project is catalog all bugs fixed after first release with the following data points: * Is it a C bug? * Is it in a stable module of the monorepo? (I will mark things stable after they have been tested.) * Is the bug in a release, even if it's in an unstable module? * Is it a build bug? * Is it a test bug? * Etc. I'll keep the catalog in a human- and mac…

Do you have an interface in mind to reduce friction for building the catalog on a daily basis? GitHub and Gitea don't really seem to provide clean ways to do this out of the box.

I am going to do it by hand for the first while.

Until I build my VCS, which will be like Fossil and have an integrated issue tracker that gets cloned with the repo.

Then I'll put the catalog into my VCS by hand and track issues normally; the catalog will build itself as people report bugs.

Re: Am I a Good C Programmer?

#37
I used C for a many years and generally liked it. I then spent the following 10 years using C++ and had mixed feelings about it. I now use Rust and I'm not sure I could ever in good faith write a new project in C or C++ again. Anyway, we're both members of the same church! :)

Re: Am I a Good C Programmer?

#38
simple answer? Nah!

Just pathetically good at seeking out some ego stroking

I hate posts like this one.

They always start off with a banal post heading

Then becomes a way of arguing the posters hiden agenda

Re: Am I a Good C Programmer?

#39
post #38

simple answer? Nah! Just pathetically good at seeking out some ego stroking I hate posts like this one. They always start off with a banal post heading Then becomes a way of arguing the posters hiden agenda

I mean, to be fair, I put a warning about the ego stroking upfront. :)
Post reply on HN