lkml.org 
[lkml]   [2021]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH 15/64] ipw2x00: Use struct_group() for memcpy() region
    On 28/07/2021, Kees Cook <keescook@chromium.org> wrote:
    > In preparation for FORTIFY_SOURCE performing compile-time and run-time
    > field array bounds checking for memcpy(), memmove(), and memset(),
    > avoid intentionally writing across neighboring fields.
    >
    > Use struct_group() in struct libipw_qos_information_element around
    > members qui, qui_type, qui_subtype, version, and ac_info, 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 qui.
    >
    > "pahole" shows no size nor member offset changes to struct
    > libipw_qos_information_element.
    >
    > Additionally corrects the size in libipw_read_qos_param_element() as
    > it was testing the wrong structure size (it should have been struct
    > libipw_qos_information_element, not struct libipw_qos_parameter_info).
    >
    > Signed-off-by: Kees Cook <keescook@chromium.org>
    > ---
    > drivers/net/wireless/intel/ipw2x00/libipw.h | 12 +++++++-----
    > drivers/net/wireless/intel/ipw2x00/libipw_rx.c | 8 ++++----
    > 2 files changed, 11 insertions(+), 9 deletions(-)
    >

    Acked-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>

    Looks fine, thanks!

    Stanislav.

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