netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Sasha Neftin <sasha.neftin@intel.com>
Cc: netdev@vger.kernel.org, eranbe@nvidia.com, tariqt@nvidia.com,
	kuba@kernel.org, anthony.l.nguyen@intel.com,
	vinicius.gomes@intel.com
Subject: Re: [PATCH net v1 1/1] net/core: Fix ETH_P_1588 flow dissector
Date: Wed, 13 Sep 2023 09:48:14 +0200	[thread overview]
Message-ID: <ZQFpPuplel7+QZwK@nanopsycho> (raw)
In-Reply-To: <20230913063905.1414023-1-sasha.neftin@intel.com>


No need to put "1/1" for a single patch.


Wed, Sep 13, 2023 at 08:39:05AM CEST, sasha.neftin@intel.com wrote:
>When a PTP ethernet raw frame with a size of more than 256 bytes followed
>by a 0xff pattern is sent to __skb_flow_dissect, nhoff value calculation
>is wrong. For example: hdr->message_length takes the wrong value (0xffff)
>and it does not replicate real header length. In this case, 'nhoff' value
>was overridden and the PTP header was badly dissected. This leads to a
>kernel crash.
>
>net/core: flow_dissector
>net/core flow dissector nhoff = 0x0000000e
>net/core flow dissector hdr->message_length = 0x0000ffff
>net/core flow dissector nhoff = 0x0001000d (u16 overflow)
>...
>skb linear:   00000000: 00 a0 c9 00 00 00 00 a0 c9 00 00 00 88
>skb frag:     00000000: f7 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>
>Using the size of the ptp_header struct will allow the corrected
>calculation of the nhoff value.

Should use imperative mood in order to make clear what the patch is
doing. Anyway,


Reviewed-by: Jiri Pirko <jiri@nvidia.com>

  reply	other threads:[~2023-09-13  7:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13  6:39 [PATCH net v1 1/1] net/core: Fix ETH_P_1588 flow dissector Sasha Neftin
2023-09-13  7:48 ` Jiri Pirko [this message]
2023-09-15  9:50 ` 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=ZQFpPuplel7+QZwK@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=anthony.l.nguyen@intel.com \
    --cc=eranbe@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sasha.neftin@intel.com \
    --cc=tariqt@nvidia.com \
    --cc=vinicius.gomes@intel.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).