Linux MHI Development
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <mani@kernel.org>
To: "Martin Fäcknitz" <faecknitz@hotsplots.de>
Cc: "Martin Fäcknitz" <faecknitz@hotsplots.de>,
	mhi@lists.linux.dev, loic.poulain@linaro.org
Subject: Re: [PATCH v2] net: mhi: set skb mac header before entering RX path
Date: Wed, 5 Jun 2024 11:38:27 +0530	[thread overview]
Message-ID: <20240605060827.GF2417@thinkpad> (raw)
In-Reply-To: <20240517211909.27874-1-faecknitz@hotsplots.de>

+ Loic

On Fri, May 17, 2024 at 11:19:09PM +0200, Martin Fäcknitz wrote:
> skb->mac_header must be set before passing the skb to the network stack,
> because skb->mac_len is calculated from skb->mac_header in
> __netif_receive_skb_core.
> 
> Some network stack components, like xfrm, are using skb->mac_len to
> check for an existing MAC header, which doesn't exist in this case. This
> leads to memory corruption.
> 
> Fixes: 7ffa7542eca6 ("net: mhi: Remove MBIM protocol")

Change looks good to me, but I fail to find the relationship with Fixes tag.

- Mani

> Signed-off-by: Martin Fäcknitz <faecknitz@hotsplots.de>
> ---
> v2: - add "Fixes" tag
>     - CC maintainers
> 
>  drivers/net/mhi_net.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/mhi_net.c b/drivers/net/mhi_net.c
> index ae169929a9d8..e432efddcb22 100644
> --- a/drivers/net/mhi_net.c
> +++ b/drivers/net/mhi_net.c
> @@ -221,6 +221,8 @@ static void mhi_net_dl_callback(struct mhi_device *mhi_dev,
>  			break;
>  		}
>  
> +		skb_reset_mac_header(skb);
> +
>  		u64_stats_update_begin(&mhi_netdev->stats.rx_syncp);
>  		u64_stats_inc(&mhi_netdev->stats.rx_packets);
>  		u64_stats_add(&mhi_netdev->stats.rx_bytes, skb->len);
> -- 
> 2.11.0
> 
> 

-- 
மணிவண்ணன் சதாசிவம்

      parent reply	other threads:[~2024-06-05  6:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17 21:19 [PATCH v2] net: mhi: set skb mac header before entering RX path Martin Fäcknitz
2024-05-22  8:36 ` Paolo Abeni
2024-06-05  6:08 ` Manivannan Sadhasivam [this message]

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=20240605060827.GF2417@thinkpad \
    --to=mani@kernel.org \
    --cc=faecknitz@hotsplots.de \
    --cc=loic.poulain@linaro.org \
    --cc=mhi@lists.linux.dev \
    /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