Re: [PATCH] scsi: hpsa: use bounded formatting for controller and IRQ names
From: Don.Brace
Date: Mon Mar 30 2026 - 12:54:14 EST
From: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
Sent: Saturday, March 28, 2026 10:09 PM
To: Don Brace - C33706 <Don.Brace@xxxxxxxxxxxxx>; James.Bottomley@xxxxxxxxxxxxxxxxxxxxx <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>; martin.petersen@xxxxxxxxxx <martin.petersen@xxxxxxxxxx>
Cc: elliott@xxxxxx <elliott@xxxxxx>; kevin.barnett@xxxxxxxx <kevin.barnett@xxxxxxxx>; JBottomley@xxxxxxxx <JBottomley@xxxxxxxx>; thenzl@xxxxxxxxxx <thenzl@xxxxxxxxxx>; scott.teel@xxxxxxxx <scott.teel@xxxxxxxx>; hare@xxxxxxx <hare@xxxxxxx>; storagedev <storagedev@xxxxxxxxxxxxx>; linux-scsi@xxxxxxxxxxxxxxx <linux-scsi@xxxxxxxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx <linux-kernel@xxxxxxxxxxxxxxx>; pengpeng@xxxxxxxxxxx <pengpeng@xxxxxxxxxxx>
Subject: [PATCH] scsi: hpsa: use bounded formatting for controller and IRQ names
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
hpsa stores the controller name in h->devname[8] and derives fixed
16-byte interrupt names from it with sprintf(). Once host_no reaches
four digits, h->devname no longer fits and the derived IRQ names then
build on top of that already overlong string.
Switch these name builders to scnprintf() so they stay inside the fixed buffers.
Fixes: 2946e82bdd76 ("hpsa: use scsi host_no as hpsa controller number")
Fixes: 8b47004a5512 ("hpsa: add interrupt number to /proc/interrupts interrupt name")
Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
Thanks for your patch.
Is there a bug filed for this patch? This patch does eliminates possible memory corruption that is perhaps covered up by structure padding...
However, now names are truncated. Hopefully no installations relying on the dev name and interrupt name will be affected? (admin scripts...)
Perhaps enlarging the buffers would help.
There are some formatting changes mixed in...
So, follow up with enlarging the buffers.
Acked-by: Don Brace <don.brace@xxxxxxxxxxxxx>