-
Notifications
You must be signed in to change notification settings - Fork 364
-I lanplus hpm check command prints garbage characters #289
Comments
Two changes included in this branch: 1. zero the extra data buffer that are not containing any IPMI message data. 2. copy only the HPM.1 property data to the pCtx response data buffer based on the data length rather than the allowed max property size. Resolves ipmitool#289 Signed-off-by: [email protected] <[email protected]>
I understand that these two file changes can be split into two different issues/branches. It shouldn't be a huge problem because both changes are simple and small enough. Some explanations:
I did not review other interface handlers and verify if they are ok or not.
|
I just reviewed sendrecv functions of other interfaces (1.8.18 source code). It appears to me only the open.c and lan.c are correct with different implementations. open.c sets only the next buffer byte to be '\0' while lan.c clears entire rest of the data buffer. lan.c method is slightly more secure, but I don't feel it's necessary. I believe, serial_terminal.c, serial_basic.c, free.c, lipmi.c, and usb.c all have the same potential problem that the command handlers, like current HpmfwupgGetComponentProperties() may accidentally access the data bytes they shouldn't. I mean, actually these interface sendrecv handlers are correct because the data_len are set correctly, and the downstream command handlers should not access data bytes beyond the data_len. Clearing the extra data buffer will hide the command handler issue. I don't really know the bmc.c, dummy.c, and imb.c. I feel, bmc.c has the same issue. Anyway, please review all of them and see if they should be updated or not. Or review all the command handlers, and see if they ever access the data beyond rsp.data_len. |
By the way, I tested serial_terminal interface, and confirmed extra data byte were printed by the hpm check command. For our application, we care about only the OpenIPMI and lan/lanplus interfaces. |
ipmitool prints the result of HPM.1 Get Component Properties (Description string) with unexpected garbage characters if it's over the -I lanplus interface.
This happens because:
Fixing either one will eliminate the issue. I'd suggest getting both fixed.
The text was updated successfully, but these errors were encountered: