public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber•org>
To: Lukasz Czapnik <lukasz.czapnik@gmail•com>
Cc: netdev@vger•kernel.org, Lukasz Czapnik <lukasz.czapnik@intel•com>
Subject: Re: [PATCH] tc: flower: fix port value truncation
Date: Tue, 28 May 2019 12:28:24 -0700	[thread overview]
Message-ID: <20190528122824.3ce628d3@hermes.lan> (raw)
In-Reply-To: <20190527210349.31833-1-lukasz.czapnik@gmail.com>

On Mon, 27 May 2019 23:03:49 +0200
Lukasz Czapnik <lukasz.czapnik@gmail•com> wrote:

> sscanf truncates read port values silently without any error. As sscanf
> man says:
> (...) sscanf() conform to C89 and C99 and POSIX.1-2001. These standards
> do not specify the ERANGE error.
> 
> Replace sscanf with safer get_be16 that returns error when value is out
> of range.
> 
> Example:
> tc filter add dev eth0 protocol ip parent ffff: prio 1 flower ip_proto
> tcp dst_port 70000 hw_tc 1
> 
> Would result in filter for port 4464 without any warning.
> 
> Fixes: 8930840e678b ("tc: flower: Classify packets based port ranges")
> Signed-off-by: Lukasz Czapnik <lukasz.czapnik@intel•com>

Looks good, applied.



      reply	other threads:[~2019-05-28 19:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27 21:03 [PATCH] tc: flower: fix port value truncation Lukasz Czapnik
2019-05-28 19:28 ` Stephen Hemminger [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=20190528122824.3ce628d3@hermes.lan \
    --to=stephen@networkplumber$(echo .)org \
    --cc=lukasz.czapnik@gmail$(echo .)com \
    --cc=lukasz.czapnik@intel$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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