bugGNU FreeIPMI - Bugs: bug #38814, ipmi-dcmi --get-dcmi-sensor-info...

 
 

bug #38814: ipmi-dcmi --get-dcmi-sensor-info command returns incorrect data

Submitter:  Michael Winiarski <mwiniarski>
Submitted:  Tue 23 Apr 2013 05:12:05 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Improper Behaviour
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 24 Apr 2013 11:27:48 PM UTC, comment #4: 

I was able to reproduce the problem on a machine here and have fixed the bug.  It'll be in FreeIPMI 1.2.6.

Albert Chu <chu11>
Group administrator
Tue 23 Apr 2013 06:42:26 PM UTC, comment #3: 

Looking at the code more closely it looks very suspicious.  I'm not sure if I've seen a motherboard before than returned > 1 record ID, which is how this bug likely slipped through.

Albert Chu <chu11>
Group administrator
Tue 23 Apr 2013 05:54:35 PM UTC, comment #2: 

Have not applied or verified any fix.

Wanted to have more qualified eyes look at the code. Wasn't sure of any possible side-effects of making the suggested changes, not being fully familiar with the code.

Michael Winiarski <mwiniarski>
Tue 23 Apr 2013 05:21:48 PM UTC, comment #1: 

That code certainly seems suspiciouss and the "/ 2" looks like it might be bad.  Does this fix fix the problem for you?

Albert Chu <chu11>
Group administrator
Tue 23 Apr 2013 05:12:05 PM UTC, original submission:  

Half of the number of records being printed and the same
record id being printed. Example:

# ipmi-dcmi --get-dcmi-sensor-info -h xxx.xxx.xxx.xxx -u xxxxxxxx -p xxxxxxxx -I 1 -l ADMIN -D LAN_2_0
Inlet Temperature SDR Record IDs
18

CPU Temperature SDR Record IDs
19

Baseboard temperature SDR Record IDs
26
26
26
26


Problem is possibly related to suspicious code in ipmi-dcmi.c _sensor_info_output(). Code looks like it results in half the number of records being printed and the same record id being printed.

Current code:

     for (i = 0; i < (sdr_record_ids_len / 2); i += 2)
        {
          uint16_t record_id = 0;
         
          record_id |= sdr_record_ids[0];
          record_id |= (sdr_record_ids[1] << 8);
         
          pstdout_printf (state_data->pstate,
                          "%u\n",
                          record_id);
          total_entity_instances_parsed++;
        }

Possible fix???

     for (i = 0; i < (sdr_record_ids_len / 2); i += 2)
        {
          uint16_t record_id = 0;
         
          record_id |= sdr_record_ids[i];
          record_id |= (sdr_record_ids[i+1] << 8);
         
          pstdout_printf (state_data->pstate,
                          "%u\n",
                          record_id);
          total_entity_instances_parsed++;
        }

I.e., use the for-loop 'i' as the index, not [0] and [1]. Also, is (sdr_record_ids_len / 2) the correct number of iterations?

Michael Winiarski <mwiniarski>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chu11 (Posted a comment)
  • -email is unavailable- added by mwiniarski (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-04-24 chu11 Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code