]> git.baikalelectronics.ru Git - kernel.git/commit
act_ife: Fix false encoding
authorYotam Gigi <yotam.gi@gmail.com>
Mon, 26 Sep 2016 10:45:26 +0000 (13:45 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Sep 2016 13:53:17 +0000 (09:53 -0400)
commit179c8af94e0be4c452319423b8c447b247065c87
treeeb6f82ecd60bbcea3c16a16809b2272b9147db59
parent3155c680d5f8ad7e68ded7cc37a279800b0a17ce
act_ife: Fix false encoding

On ife encode side, the action stores the different tlvs inside the ife
header, where each tlv length field should refer to the length of the
whole tlv (without additional padding) and not just the data length.

On ife decode side, the action iterates over the tlvs in the ife header
and parses them one by one, where in each iteration the current pointer is
advanced according to the tlv size.

Before, the encoding encoded only the data length inside the tlv, which led
to false parsing of ife the header. In addition, due to the fact that the
loop counter was unsigned, it could lead to infinite parsing loop.

This fix changes the loop counter to be signed and fixes the encoding to
take into account the tlv type and size.

Fixes: 258a20d3e7d4 ("net sched: fix encoding to use real length")
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_ife.c