netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Saeed Mahameed <saeedm@nvidia.com>
Cc: Leon Romanovsky <leon@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH RESEND] net/mlx5e: Use struct_group() for memcpy() region
Date: Wed, 26 Jan 2022 14:53:31 -0800	[thread overview]
Message-ID: <202201261452.97A809BE9C@keescook> (raw)
In-Reply-To: <20220126212854.6gxffia7vj6cbtbh@sx1>

On Wed, Jan 26, 2022 at 01:28:54PM -0800, Saeed Mahameed wrote:
> On 24 Jan 09:22, 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() in struct vlan_ethhdr around members h_dest and
> > h_source, 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 h_dest.
> > 
> > "pahole" shows no size nor member offset changes to struct vlan_ethhdr.
> > "objdump -d" shows no object code changes.
> > 
> > Cc: Saeed Mahameed <saeedm@nvidia.com>
> > Cc: Leon Romanovsky <leon@kernel.org>
> > Cc: "David S. Miller" <davem@davemloft.net>
> > Cc: Jakub Kicinski <kuba@kernel.org>
> > Cc: netdev@vger.kernel.org
> > Cc: linux-rdma@vger.kernel.org
> > Signed-off-by: Kees Cook <keescook@chromium.org>
> > ---
> > Since this results in no binary differences, I will carry this in my tree
> > unless someone else wants to pick it up. It's one of the last remaining
> > clean-ups needed for the next step in memcpy() hardening.
> > ---
> 
> applied to net-next-mlx5

Thanks! How often does net-next-mlx5 flush into net-next?

-- 
Kees Cook

  reply	other threads:[~2022-01-26 22:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24 17:22 [PATCH RESEND] net/mlx5e: Use struct_group() for memcpy() region Kees Cook
2022-01-26 21:28 ` Saeed Mahameed
2022-01-26 22:53   ` Kees Cook [this message]
2022-01-26 23:38     ` Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202201261452.97A809BE9C@keescook \
    --to=keescook@chromium.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).