net: ipv4: fix a memleak in ip_setup_cork
stable inclusion from stable-v4.19.307 commit 3241813266b623a1153db37f0204cf4225bd6864 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I970CO CVE: NA -------------------------------- [ Upstream commit 5dee6d6923458e26966717f2a3eae7d09fc10bf6 ] When inetdev_valid_mtu fails, cork->opt should be freed if it is allocated in ip_setup_cork. Otherwise there could be a memleak. Fixes: 501a90c9 ("inet: protect against too small mtu values.") Signed-off-by:Zhipeng Lu <alexious@zju.edu.cn> Reviewed-by:
Eric Dumazet <edumazet@google.com> Link: https://lore.kernel.org/r/20240129091017.2938835-1-alexious@zju.edu.cn Signed-off-by:
Jakub Kicinski <kuba@kernel.org> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Yongqiang Liu <liuyongqiang13@huawei.com>
Loading
Please sign in to comment