Skip to content
  • Kees Cook's avatar
    stddef.h: Introduce sizeof_field() · 4229a470
    Kees Cook authored
    
    
    The size of fields within a structure is needed in a few places in the
    kernel already, and will be needed for the usercopy whitelisting when
    declaring whitelist regions within structures. This creates a dedicated
    macro and redefines offsetofend() to use it.
    
    Existing usage, ignoring the 1200+ lustre assert uses:
    
    $ git grep -E 'sizeof\(\(\((struct )?[a-zA-Z_]+ \*\)0\)->' | \
    	grep -v staging/lustre | wc -l
    65
    
    Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    4229a470