]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
tipc: fix potential memory leak in __tipc_sendmsg()
authorTung Nguyen <tung.q.nguyen@dektech.com.au>
Thu, 28 Nov 2019 03:10:05 +0000 (10:10 +0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 6 Mar 2020 07:25:26 +0000 (02:25 -0500)
commit8a0246be29a037a92529ae5bd61915a898736ff9
tree470e7ac2a6613875de71ab0bab6053b29f767eff
parent2c677beb38ebe76e207e9d7c7a68de2532609c72
tipc: fix potential memory leak in __tipc_sendmsg()

BugLink: https://bugs.launchpad.net/bugs/1864060
commit 2fe97a578d7bad3116a89dc8a6692a51e6fc1d9c upstream.

When initiating a connection message to a server side, the connection
message is cloned and added to the socket write queue. However, if the
cloning is failed, only the socket write queue is purged. It causes
memory leak because the original connection message is not freed.

This commit fixes it by purging the list of connection message when
it cannot be cloned.

Fixes: 6787927475e5 ("tipc: buffer overflow handling in listener socket")
Reported-by: Hoang Le <hoang.h.le@dektech.com.au>
Signed-off-by: Tung Nguyen <tung.q.nguyen@dektech.com.au>
Acked-by: Ying Xue <ying.xue@windriver.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/tipc/socket.c