]> asedeno.scripts.mit.edu Git - linux.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)
committerDavid S. Miller <davem@davemloft.net>
Fri, 29 Nov 2019 07:09:14 +0000 (23:09 -0800)
commit2fe97a578d7bad3116a89dc8a6692a51e6fc1d9c
treeb2d92eff181c5d7de25e68d0d47d4118b0795578
parent61183b056b49e2937ff92a1424291ba36a6f6d05
tipc: fix potential memory leak in __tipc_sendmsg()

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>
net/tipc/socket.c