[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20160428.155336.1692865162354830955.davem@davemloft.net>
Date: Thu, 28 Apr 2016 15:53:36 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: marcelo.leitner@...il.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] net: fix net_gso_ok for new GSO types.
From: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
Date: Mon, 25 Apr 2016 15:13:17 -0300
> Fix casting in net_gso_ok. Otherwise the shift on
> gso_type << NETIF_F_GSO_SHIFT may hit the 32th bit and make it look like
> a INT_MIN, which is then promoted from signed to uint64 which is
> 0xffffffff80000000, resulting in wrong behavior when it is and'ed with
> the feature itself, as in:
...
> So that this:
> return (features & feature) == feature;
> Actually works on more bits than expected and invalid ones.
>
> Fix is to promote it earlier.
>
> Issue noted while rebasing SCTP GSO patch but posting separetely as
> someone else may experience this meanwhile.
>
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
Great catch, applied, thanks Marcelo.
Powered by blists - more mailing lists