Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When would I not wish to enable “Control Flow Guard” in Microsoft Visual Studio?

To quote from MSDN:

Control Flow Guard (CFG) is a highly-optimized platform security feature that was created to combat memory corruption vulnerabilities. By placing tight restrictions on where an application can execute code from, it makes it much harder for exploits to execute arbitrary code through vulnerabilities such as buffer overflows.

We strongly encourage developers to enable CFG for their applications. You don't have to enable CFG for every part of your code, as a mixture of CFG enabled and non-CFG enabled code will execute fine. But failing to enable CFG for all code can open gaps in the protection. Furthermore, CFG enabled code works fine on "CFG-Unaware" versions of Windows and is therefore fully compatible with them.

So when would I not enable it?

Or in other words, what do I have to check about my code before I enable it and what are the risks?

like image 373
Ian Ringrose Avatar asked Nov 07 '22 22:11

Ian Ringrose


1 Answers

Looks like it makes program to run slower. They do not say by how much, though. Plain language of the article suggests that all indirect calls are now going through kernel? If it is true, this is truly disastrous.

like image 147
SergeyA Avatar answered Nov 14 '22 22:11

SergeyA