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

 
 

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

Submitted by:  Michael Winiarski <mwiniarski>
Submitted on:  Tue 23 Apr 2013 05:12:05 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Improper Behaviour
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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>
Project 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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 24 Apr 2013 11:27:53 PM UTCchu11Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1