diff options
author | Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> | 2019-01-29 11:06:39 +0530 |
---|---|---|
committer | Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> | 2019-02-02 02:37:41 +0000 |
commit | ef02401a871e29beabfda6b37db54c283a1e0f69 (patch) | |
tree | f724771587b6586e5b005ed0631eb90ac6fe546a | |
parent | 57d4a830c36fbbecea6f923f6223f03cb14f6321 (diff) | |
download | phosphor-host-ipmid-ef02401a871e29beabfda6b37db54c283a1e0f69.tar.gz phosphor-host-ipmid-ef02401a871e29beabfda6b37db54c283a1e0f69.zip |
Fix: Check reserved fields in channel cmds request
Check reserved fields in channel cmds request and
return 0xCC, if reserved fields are set
Unit-Test:
1. Verified 0xCC is returned if reserved fields are set
ipmitool raw 0x6 0x40 0x11 0x82 0x81
Change-Id: I4ca18c35d1435c6f9a636eb2c2730e63d8df319b
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
-rw-r--r-- | user_channel/channelcommands.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/user_channel/channelcommands.cpp b/user_channel/channelcommands.cpp index fd46837..546adb0 100644 --- a/user_channel/channelcommands.cpp +++ b/user_channel/channelcommands.cpp @@ -170,9 +170,9 @@ ipmi_ret_t ipmiSetChannelAccess(ipmi_netfn_t netfn, ipmi_cmd_t cmd, } uint8_t chNum = convertCurrentChannelNum(req->chNum); - if (!isValidChannel(chNum)) + if (!isValidChannel(chNum) || req->reserved_1 != 0 || req->reserved_2 != 0) { - log<level::DEBUG>("Set channel access - Parameter out of range"); + log<level::DEBUG>("Set channel access - Invalid field in request"); return IPMI_CC_INVALID_FIELD_REQUEST; } @@ -275,9 +275,9 @@ ipmi_ret_t ipmiGetChannelAccess(ipmi_netfn_t netfn, ipmi_cmd_t cmd, } uint8_t chNum = convertCurrentChannelNum(req->chNum); - if (!isValidChannel(chNum)) + if (!isValidChannel(chNum) || req->reserved_1 != 0 || req->reserved_2 != 0) { - log<level::DEBUG>("Get channel access - Parameter out of range"); + log<level::DEBUG>("Get channel access - Invalid field in request"); return IPMI_CC_INVALID_FIELD_REQUEST; } @@ -341,9 +341,9 @@ ipmi_ret_t ipmiGetChannelInfo(ipmi_netfn_t netfn, ipmi_cmd_t cmd, } uint8_t chNum = convertCurrentChannelNum(req->chNum); - if (!isValidChannel(chNum)) + if (!isValidChannel(chNum) || req->reserved_1 != 0) { - log<level::DEBUG>("Get channel info - Parameter out of range"); + log<level::DEBUG>("Get channel info - Invalid field in request"); return IPMI_CC_INVALID_FIELD_REQUEST; } |