Skip to content
  • Josh Poimboeuf's avatar
    mm/usercopy: get rid of CONFIG_DEBUG_STRICT_USER_COPY_CHECKS · 0d025d27
    Josh Poimboeuf authored
    There are three usercopy warnings which are currently being silenced for
    gcc 4.6 and newer:
    
    1) "copy_from_user() buffer size is too small" compile warning/error
    
       This is a static warning which happens when object size and copy size
       are both const, and copy size > object size.  I didn't see any false
       positives for this one.  So the function warning attribute seems to
       be working fine here.
    
       Note this scenario is always a bug and so I think it should be
       changed to *always* be an error, regardless of
       CONFIG_DEBUG_STRICT_USER_COPY_CHECKS.
    
    2) "copy_from_user() buffer size is not provably correct" compile warning
    
       This is another static warning which happens when I enable
       __compiletime_object_size() for new compilers (and
       CONFIG_DEBUG_STRICT_USER_COPY_CHECKS).  It happens when object size
       is const, but copy size is *not*.  In this case there's no way to
       compare the two at build time, so it gives the warning.  (Note...
    0d025d27