Compiler Optimizations Can Cause Security Problems

As the title states: when writing code, the programmer should take in mind that the compiler optimizations might remove part of the code or change its order.

Also when doing vulnerabilities code review you should take this into account.

Example of a null exception race condition caused by compiler optimization (in c++ or c this might cause a jump to an undesired address when the pointer gets overridden in the race condition):

http://stackoverflow.com/questions/18499576/raising-events-in-multi-threaded-environment

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s