The size count paramters is not the same with actual buffer length in memset functions.

Bug #1838219 reported by YeHuiSheng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Won't Fix
Low
YeHuiSheng

Bug Description

The size count paramters is not the same with actual buffer length in memset functions.

case 1:
    In the function daemon_service_run (alarminit.cpp metal module), memset use MAX_ALARM_REQ_MSG_SIZE which is not the same with the msg actual length MAX_ALARM_REQ_SIZE.
Obviously, that is a clerical error.

               char msg [MAX_ALARM_REQ_SIZE] ;
               memset ( &msg , 0, MAX_ALARM_REQ_MSG_SIZE );
               int bytes = mtcalarm_req_sock_ptr->read((char*)&msg, MAX_ALARM_REQ_SIZE-1 );

case 2:
    In the lmonHdlr.cpp, the parameter interfaces is defined as a struct array.

               static interface_ctrl_type interfaces[INTERFACES_MAX];

    However, in the begining of funciton daemon_service_run (lmonHdlr.cpp metal module), interfaces is initialed by memset with sizeof(interface_ctrl_type), then only interfaces[0] is initialed.

               memset (&interfaces, 0, sizeof(interface_ctrl_type));

Tags: stx.metal
YeHuiSheng (hsye)
Changed in starlingx:
assignee: nobody → YeHuiSheng (hsye)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to metal (master)

Fix proposed to branch: master
Review: https://review.opendev.org/673196

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.opendev.org/673198

Revision history for this message
Ghada Khalil (gkhalil) wrote :

Low priority / not gating - code cleanup suggestion w/ no noted system impact

tags: added: stx.metal
Changed in starlingx:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to metal (master)

Reviewed: https://review.opendev.org/673196
Committed: https://git.openstack.org/cgit/starlingx/metal/commit/?id=4391de7ea1e9235ebb164b811783665c98abc8f0
Submitter: Zuul
Branch: master

commit 4391de7ea1e9235ebb164b811783665c98abc8f0
Author: YeHuiSheng <email address hidden>
Date: Mon Jul 29 11:01:12 2019 +0800

    Modify the wrong size count paramter of memset in lmonHdlr.cpp

    Change-Id: Ifb72318da17bd741fe4b897d2c2ca17acf0ca6f5
    Partial-Bug: 1838219
    Signed-off-by: YeHuiSheng <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on metal (master)

Change abandoned by Bart Wensley (<email address hidden>) on branch: master
Review: https://review.opendev.org/673198
Reason: This patch has been idle for more than six months. I am abandoning it to keep the review queue sane. If you are still interested in working on this patch, please unabandon it and upload a new patchset.

Revision history for this message
Ramaswamy Subramanian (rsubrama) wrote :

No progress on this bug for more than 2 years. Candidate for closure.

If there is no update, this issue is targeted to be closed as 'Won't Fix' in 2 weeks.

Revision history for this message
Ramaswamy Subramanian (rsubrama) wrote :

Changing the status to 'Won't Fix' as there is no activity.

Changed in starlingx:
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.