From: Simon Horman <horms@kernel.org>
To: edward.cree@amd.com
Cc: linux-net-drivers@amd.com, davem@davemloft.net, kuba@kernel.org,
edumazet@google.com, pabeni@redhat.com,
Edward Cree <ecree.xilinx@gmail.com>,
netdev@vger.kernel.org, habetsm.xilinx@gmail.com,
Andy Moreton <andy.moreton@amd.com>
Subject: Re: [PATCH net] sfc: allocate a big enough SKB for loopback selftest packet
Date: Tue, 22 Aug 2023 09:38:25 +0200 [thread overview]
Message-ID: <20230822073825.GR2711035@kernel.org> (raw)
In-Reply-To: <20230821180153.18652-1-edward.cree@amd.com>
On Mon, Aug 21, 2023 at 07:01:53PM +0100, edward.cree@amd.com wrote:
> From: Edward Cree <ecree.xilinx@gmail.com>
>
> Cited commits passed a size to alloc_skb that was only big enough for
> the actual packet contents, but the following skb_put + memcpy writes
> the whole struct efx_loopback_payload including leading and trailing
> padding bytes (which are then stripped off with skb_pull/skb_trim).
> This could cause an skb_over_panic, although in practice we get saved
> by kmalloc_size_roundup.
> Pass the entire size we use, instead of the size of the final packet.
>
> Reported-by: Andy Moreton <andy.moreton@amd.com>
> Fixes: cf60ed469629 ("sfc: use padding to fix alignment in loopback test")
> Fixes: 30c24dd87f3f ("sfc: siena: use padding to fix alignment in loopback test")
> Fixes: 1186c6b31ee1 ("sfc: falcon: use padding to fix alignment in loopback test")
> Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2023-08-22 7:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-21 18:01 [PATCH net] sfc: allocate a big enough SKB for loopback selftest packet edward.cree
2023-08-22 7:38 ` Simon Horman [this message]
2023-08-22 18:20 ` patchwork-bot+netdevbpf
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=20230822073825.GR2711035@kernel.org \
--to=horms@kernel.org \
--cc=andy.moreton@amd.com \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=edward.cree@amd.com \
--cc=habetsm.xilinx@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-net-drivers@amd.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.