diff options
author | Patrick Venture <venture@google.com> | 2019-02-01 14:44:15 -0800 |
---|---|---|
committer | Patrick Venture <venture@google.com> | 2019-02-01 15:13:43 -0800 |
commit | 86c87f55de9bb69f6e49c6203ffb0e12947ea7cf (patch) | |
tree | 243851da4f76e3d8f8c493de096dca8e670aad60 /manager.hpp | |
parent | dc82ab15f27ca4481518e9c151c20646d4afdc8b (diff) | |
download | phosphor-ipmi-blobs-86c87f55de9bb69f6e49c6203ffb0e12947ea7cf.tar.gz phosphor-ipmi-blobs-86c87f55de9bb69f6e49c6203ffb0e12947ea7cf.zip |
manager: add hard-coded read checks
The host-client cannot try to read back more than this number of bytes
without hitting a memory overflow in phosphor-host-ipmid. The method we
can call to dynamically receive that number isn't currently linking out
of the userlayer library.
Note: Once the configure_ac can find and provide the userlayer library
from phosphor-host-ipmid, we can remove the hard-coded 64 and 0xe.
Change-Id: I08f6bb59ce44279f76a494dccaa477ae75d532c4
Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'manager.hpp')
-rw-r--r-- | manager.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/manager.hpp b/manager.hpp index d7282e6..c0c4249 100644 --- a/manager.hpp +++ b/manager.hpp @@ -2,6 +2,7 @@ #include <blobs-ipmid/blobs.hpp> #include <ctime> +#include <host-ipmid/oemrouter.hpp> #include <memory> #include <string> #include <unordered_map> @@ -10,6 +11,16 @@ namespace blobs { +/* The maximum read size. + * NOTE: Once this can be dynamically determined, we'll switch to that method. + * Having this in a header allows it to used cleanly for now. + */ +const int crcSize = sizeof(uint16_t); +const int btReplyHdrLen = 5; +const int btTransportLength = 64; +const uint32_t maximumReadSize = + btTransportLength - (btReplyHdrLen + oem::groupMagicSize + crcSize); + struct SessionInfo { SessionInfo() = default; |