lkml.org 
[lkml]   [2021]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH 06/64] bnxt_en: Use struct_group_attr() for memcpy() region
    On Tue, Jul 27, 2021 at 2:01 PM Kees Cook <keescook@chromium.org> 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 queue_id, min_bw, max_bw, tsa, pri_lvl,
    > and bw_weight 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 queue_id.
    >
    > "pahole" shows no size nor member offset changes to struct bnxt_cos2bw_cfg.
    > "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>

    Thanks.
    Reviewed-by: Michael Chan <michael.chan@broadcom.com>
    [unhandled content-type:application/pkcs7-signature]
    \
     
     \ /
      Last update: 2021-07-28 03:03    [W:4.078 / U:0.204 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site