[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190528122824.3ce628d3@hermes.lan>
Date: Tue, 28 May 2019 12:28:24 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Lukasz Czapnik <lukasz.czapnik@...il.com>
Cc: netdev@...r.kernel.org, Lukasz Czapnik <lukasz.czapnik@...el.com>
Subject: Re: [PATCH] tc: flower: fix port value truncation
On Mon, 27 May 2019 23:03:49 +0200
Lukasz Czapnik <lukasz.czapnik@...il.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@...el.com>
Looks good, applied.
Powered by blists - more mailing lists