lkml.org 
[lkml]   [2021]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 07/64] staging: rtl8192e: Use struct_group() for memcpy() region
    From
    Date
    On 7/27/21 3:57 PM, Kees Cook wrote:
    > In preparation for FORTIFY_SOURCE performing compile-time and run-time
    > field bounds checking for memcpy(), memmove(), and memset(), avoid
    > intentionally writing across neighboring fields.
    >
    > Use struct_group() around members addr1, addr2, and addr3 in struct
    > rtllib_hdr_4addr, and members qui, qui_type, qui_subtype, version,
    > and ac_info in struct rtllib_qos_information_element, so they can be
    > referenced together. This will allow memcpy() and sizeof() to more easily
    > reason about sizes, improve readability, and avoid future warnings about
    > writing beyond the end of addr1 and qui.
    >
    > "pahole" shows no size nor member offset changes to struct
    > rtllib_hdr_4addr nor struct rtllib_qos_information_element. "objdump -d"
    > shows no meaningful object code changes (i.e. only source line number
    > induced differences and optimizations).
    >
    > Signed-off-by: Kees Cook<keescook@chromium.org>

    Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
    Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

    Looks good.

    Larry

    \
     
     \ /
      Last update: 2021-07-28 00:31    [W:3.597 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site