• Kees Cook's avatar
    enic: Avoid false positive under FORTIFY_SOURCE · 40b9385d
    Kees Cook authored
    FORTIFY_SOURCE has been ignoring 0-sized destinations while the kernel
    code base has been converted to flexible arrays. In order to enforce
    the 0-sized destinations (e.g. with __counted_by), the remaining 0-sized
    destinations need to be handled. Unfortunately, struct vic_provinfo
    resists full conversion, as it contains a flexible array of flexible
    arrays, which is only possible with the 0-sized fake flexible array.
    
    Use unsafe_memcpy() to avoid future false positives under
    CONFIG_FORTIFY_SOURCE.
    Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    40b9385d
vnic_vic.c 1.41 KB