none
GSFunctionOptimizeCheck BinScope

    คำถาม

  • Hi,

    I got a method called Method() in a project proj.vcxproj throughing BinScope error GSFunctionOptimizeCheck failed in BinScope.

    Optimation is enabled for the project.

    Tried with /O1, /O2, and /Ox but the issue is not solved.

    If i disable optimation its giving 41 methods name under same error type and 1 method if optimization is enabled.

    Is there a problem with function or settings?

    --Lakshman

    • ย้ายโดย Helen Zhao 23 มีนาคม 2555 9:23 (From:Visual C++ General)
    21 มีนาคม 2555 10:38

คำตอบ

  • Read this page: http://msdn.microsoft.com/en-us/library/8dbf701c(VS.80).aspx

    /GS is enabled by default, but even with that, there are configurations where it won't actually get applied.


    The compiler does not provide security protection for vulnerable parameters in the following situations:

    • Functions that do not contain a buffer.

    • If optimizations (/O Options (Optimize Code)) are not enabled.

    • Functions with a variable argument list (...).

    • Functions marked with naked (C++).

    • Functions containing inline assembly code in the first statement.

    • If a parameter is used only in ways that are less likely to be exploitable in the event of a buffer overrun.

    The easiest way to check is to go into the project's property pages.  Expand Configuration PropertiesC/C++, and then click onOptimization.  If the first line-item in the configuration page has the value, Disabled (/Od) then change it to something else.  The default Release Mode setting is Maximize Speed (/O2)


    Delphine GARRO

    • เสนอเป็นคำตอบโดย GARRO Delphine 26 มีนาคม 2555 15:45
    • ทำเครื่องหมายเป็นคำตอบโดย SDL TeamModerator 30 มีนาคม 2555 0:14
    21 มีนาคม 2555 13:34

ตอบทั้งหมด

  • Read this page: http://msdn.microsoft.com/en-us/library/8dbf701c(VS.80).aspx

    /GS is enabled by default, but even with that, there are configurations where it won't actually get applied.


    The compiler does not provide security protection for vulnerable parameters in the following situations:

    • Functions that do not contain a buffer.

    • If optimizations (/O Options (Optimize Code)) are not enabled.

    • Functions with a variable argument list (...).

    • Functions marked with naked (C++).

    • Functions containing inline assembly code in the first statement.

    • If a parameter is used only in ways that are less likely to be exploitable in the event of a buffer overrun.

    The easiest way to check is to go into the project's property pages.  Expand Configuration PropertiesC/C++, and then click onOptimization.  If the first line-item in the configuration page has the value, Disabled (/Od) then change it to something else.  The default Release Mode setting is Maximize Speed (/O2)


    Delphine GARRO

    • เสนอเป็นคำตอบโดย GARRO Delphine 26 มีนาคม 2555 15:45
    • ทำเครื่องหมายเป็นคำตอบโดย SDL TeamModerator 30 มีนาคม 2555 0:14
    21 มีนาคม 2555 13:34
  • Hi Siddireddy,

    According to your description, I'd like to move this thread to "Microsoft Security Development Lifecycle (SDL) Forum" for efficient responses.

    Thanks for your understanding and active participation in the MSDN Forum.
    Have a nice day!


    Helen Zhao [MSFT]
    MSDN Community Support | Feedback to us

    23 มีนาคม 2555 9:22