linux-cp: fix tap interface attrs in case the sw pool realloc'd 19/35719/3
authorVladislav Grishenko <themiron@yandex-team.ru>
Sun, 20 Mar 2022 10:55:25 +0000 (15:55 +0500)
committerMatthew Smith <mgsmith@netgate.com>
Tue, 29 Mar 2022 15:24:58 +0000 (15:24 +0000)
commitfbc4ad5fd4a48c49c492912fe75e33a2dbb41dab
tree49fd7ff04715a39d79552652a27060abb62c6705
parentbf82a66de7653921e3c25ae444d372d2eddeee9f
linux-cp: fix tap interface attrs in case the sw pool realloc'd

Creating tap interface / sub interface causes allocation of a new
software interface with possible sw interface pool reallocation.
In such case accessing L3 MTU and interface flags by obsolete sw
pointer is UAF.
Instead, keep desired tap interface MTU value before sw intreface
creation and refetch sw pointer right before sw flags inheritance.

Type: fix
Fixes: b89c1ddcb3b4f9138ca3ebefb2115f896ff3e1bd
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I21ea46d146d11060bb9bedc77377ab17ae9e22e8
src/plugins/linux-cp/lcp_interface.c