Bug 2231204 - REDHAT 8.8 version sgpio tool report buffer overflow when set the dis led status
Summary: REDHAT 8.8 version sgpio tool report buffer overflow when set the dis led status
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: sgpio
Version: 8.8
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Lukáš Nykrýn
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-11 02:19 UTC by wangdong28
Modified: 2023-08-15 07:06 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-165551 0 None None None 2023-08-11 02:21:55 UTC

Description wangdong28 2023-08-11 02:19:51 UTC
Description of problem:
when use sgpio do the led status test, some disk will report this error:
[dong@localhost sgpio]$ ./sgpio -d sdc -s locate
*** buffer overflow detected ***: ./sgpio terminated

Through testing, it is the sgpio code bug.

Version-Release number of selected component (if applicable):
Tested 8.6 and 8.8, they all have issue

How reproducible:
connect 10 SATA disk to server and than perform the sgpio cmd.

Steps to Reproduce:
1.connect 10 disks on server
2.find the port num > 10 disk(>10 is necessary condition to trigger this err), such as follow sdc
[dong@localhost ~]$ lsscsi 
[0:2:0:0]    disk    Lenovo   RAID 730-8i 1GB  4.68  /dev/sda 
[15:0:0:0]   disk    ATA      ThinkSystem M.2  00-0  /dev/sdc 
[17:0:0:0]   process Marvell  Console          1.01  -        
[18:2:0:0]   disk    Lenovo   RAID 730-8i 1GB  4.68  /dev/sdb 
[19:0:0:0]   cd/dvd  XCC      Virtual Media    0399  /dev/sr0 
3.perform sgpio cmd: sgpio -d sdc -s locate

Actual results:
sgpio -d sdc -s locate will report overflow err

Expected results:
sgpio -d sdc -s locate will show the right led flashing

Additional info:
we have traced the root cause, in sgpio soure code in function led_set:
        if(sprintf(disks[index].name,"Port %d", port_num) < 0){
		printf("Error: Unable to write port number to buffor!\n");
		return -1;
	}
name is char name[7], and once the disk num exceed 9, it will cause out of bound issue, please set the array as the 11 to avoid this issue.

Comment 1 wangdong28 2023-08-14 02:57:04 UTC
Hi,
Anything update?

Comment 2 Lukáš Nykrýn 2023-08-15 06:18:34 UTC
Hello, given the low priority of this component, the fact that this tool is not used in productions and the fact we are at the end of our development of 8.9 I don't expect we will work on this anytime soon.

Comment 3 wangdong28 2023-08-15 06:27:20 UTC
Hello, so this issue won't fix in two weeks right? Do we have any plan to fix this issue in the future redhat release version?

Comment 4 Lukáš Nykrýn 2023-08-15 06:52:49 UTC
Two weeks are not realistic. Right now, doable timeline is rhel-8.10 and rhel-9.4

Comment 5 wangdong28 2023-08-15 07:06:16 UTC
ok, has set the Severity as low


Note You need to log in before you can comment on or make changes to this bug.