]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
msg/msg_types: fix the entity_addr_t's decoder 17699/head
authorKefu Chai <kchai@redhat.com>
Wed, 13 Sep 2017 14:55:58 +0000 (22:55 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 15 Sep 2017 09:26:19 +0000 (17:26 +0800)
commitaa83c2c42dd52c8b1d459386309491feccfea567
tree541dda157eddb22a99d4905db3b54e0a5f23765d
parent520a5a218c68f00ac269e0fadf343f0aebef5dbd
msg/msg_types: fix the entity_addr_t's decoder

the daemon is vulnerable to malicious client, which is able to send
large elen, and corrupt the stack, etc.

* throw at seeing corrupted entity_addr_t where its elen exceeds
  the length of sockaddr
* handle the exception thrown when decoding entity_addr_t in messenger
  layer.
* if a malicious client manages to send a corrutped entity_addr_t to
  daemon, daemon will crash because decode fails and the exception is
  not handled. it's better than continuing working with the bogus
  message.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/msg/async/AsyncConnection.cc
src/msg/msg_types.h
src/msg/simple/Pipe.cc