News for hackers. Stuff that matters.
Re:How to C in 2016 by pcwalton on Saturday January 09, 2016 @01:45PM (#10872336)
> Security is not a property of the tool, it is a property of the tool's wielder.

How many memory safety bugs do you see in Java applications compared to C applications?

Re:How to C in 2016 by hyc_symas on Saturday January 09, 2016 @02:07PM (#10872419)
If Java memory safety is so good, why does NullPointerException still exist in the language?
Re:How to C in 2016 by pcwalton on Saturday January 09, 2016 @02:47PM (#10872562)
I'm not talking about NPE (though I would be happy to elaborate on how not having null pointers also reduces crashes in the wild). I'm talking about exploitable and/or non-type-safe memory safety problems.

Writing in Java is an effective way to reduce remote code execution vulnerabilities over writing in C. Statistics have shown this over and over again.

Re:How to C in 2016 by hyc_symas on Saturday January 09, 2016 @03:31PM (#10872753)
The very fact that NPE exists, in a language which doesn't have pointers, running on a JVM that doesn't have pointers, is evidence that the entire model of "doesn't have pointers" is a sham. The reality of computer architecture is that data resides in memory, memory is an array of bytes, and bytes have addresses (i.e., pointers) and denying this fact is impossible. Even in a pure pointerless system like Java. And if there are pointers in the system, somewhere, anywhere, they are exploitable.

Remote code execution vulnerabilities in C are less a feature of the language syntax and mostly due to the abysmally poor C library, which is regrettably part of "C The Language" - but no one forces you to use it - there are better libraries. Also, it's an artifact of implementation - just as Java's supposed immunity is an artifact of implementation, not an inherent feature of the language syntax.

Case in point http://www.trendmicro.com/vinfo/us/threat-encyclopedia/vulne...

As for RCEs in C code - these would be easily avoided if the implementation used two separate stacks - one for function parameters, and one for return addresses. If user code can only overwrite passive data, stack smashing attacks would be totally ineffective. Again - there's nothing in the C language specification that dictates or defines this particular vulnerability. It is solely an internal implementation decision.

Re:How to C in 2016 by pcwalton on Saturday January 09, 2016 @06:24PM (#10873291)
> As for RCEs in C code - these would be easily avoided if the implementation used two separate stacks - one for function parameters, and one for return addresses.

No. Increasingly, RCEs are due to vtable confusion resulting from use after free.

Re:How to C in 2016 by hyc_symas on Sunday January 10, 2016 @03:12AM (#10874644)
Sounds like you're the one with confusion; vtables are not a feature of C. C++, sure, but that's a different conversation. Your point is invalid.
Re:How to C in 2016 by pjmlp on Saturday January 09, 2016 @05:03PM (#10873078)
References are pointers.