Menu

Obsolete (git) Merge Request #18: Fix for ID:497 - long response crashes raw command (rejected)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

Vernon Mauery wants to merge 1 commit from /u/vmauery11/ipmitool/ to master, 2018-04-05

This increases the buffer size for outgoing and incoming packets so that the BMC does not overflow the buffer and cause ipmitool to segfault.

Commit Date  
[d2e772] (id_497_raw_command_buffer_size) by Vernon Mauery Vernon Mauery

ID:497 Raw command to allow responses larger than 256 bytes

A full response (though not very likely) could be as large a a full UDP
packet over RMCP+. In theory other interfaces could have an even larger
size, but this is a pretty good compromise for now.

Signed-off-by: Vernon Mauery <vernon.mauery@...>

2017-11-03 21:37:46 Tree

Discussion

  • Alexander Amelkin

    IPMI_BUF_SIZE is used in a lot of places. Increasing it to 64K will result in static allocation of 512K in ipmi_tsol.c, for example.

    It looks to me like a more thorough refactoring of the code is required.
    For instance, I'd go with dynamic allocation of the buffers (not just here, but everywhere) and would base their sizes on the maximum possible value for the relevant structure field size, using something like
    #define MAX_VAL(t) ((typeof(t))(~((typeof(t))0)))

    For the code in question that would be ipmiv2_payload.payload_length field.

    Anyway, I can't accept this pull request as-is.

     
  • Vernon Mauery

    Vernon Mauery - 2018-04-05
    • Status: open --> rejected
     

Log in to post a comment.