[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACKFLinDc6Y+P8eZ=450yA1nMC7swTURLtcdyiNR=9J6dfFyBg@mail.gmail.com>
Date: Tue, 27 Jul 2021 18:03:22 -0700
From: Michael Chan <michael.chan@...adcom.com>
To: Kees Cook <keescook@...omium.org>
Cc: linux-hardening@...r.kernel.org,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
Keith Packard <keithpac@...zon.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
open list <linux-kernel@...r.kernel.org>,
linux-wireless@...r.kernel.org, Netdev <netdev@...r.kernel.org>,
dri-devel@...ts.freedesktop.org, linux-staging@...ts.linux.dev,
linux-block@...r.kernel.org, linux-kbuild@...r.kernel.org,
clang-built-linux@...glegroups.com
Subject: Re: [PATCH 06/64] bnxt_en: Use struct_group_attr() for memcpy() region
On Tue, Jul 27, 2021 at 2:01 PM Kees Cook <keescook@...omium.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@...omium.org>
Thanks.
Reviewed-by: Michael Chan <michael.chan@...adcom.com>
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)
Powered by blists - more mailing lists