]> git.puffer.fish Git - mirror/frr.git/commit
ldpd: fix heap-use-after-free at exit
authorRenato Westphal <renato@opensourcerouting.org>
Tue, 10 Oct 2017 12:22:41 +0000 (09:22 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Tue, 10 Oct 2017 12:37:31 +0000 (09:37 -0300)
commit50732983b93cd44f95bbb28b43ea8401c487b9cd
tree67c083125c27a8486e2fb1b83b9a4c6a018367c4
parente56ab0e97122d35d3f8d21faf820a90eb1953948
ldpd: fix heap-use-after-free at exit

This problems happens because, in this port, whenever the child
processes want to log something they send a message to the parent. But
in the shutdown functions the first thing we do is to close the pipes
to the parent process. With that said, add some protections to prevent
the child processes from trying to use a closed pipe and just ignore
their log messages during shutdown. In the future we need to share
the logging configuration with the child processes so they can send
log messages on their own.

While here, remove some unnecessary calls to msgbuf_write() in
ldpe_shutdown().

Fixes #1253.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ldpd/lde.c
ldpd/ldpe.c