From: Zijie Zhao qla2x00_get_tgt_stats() requires a 16-byte request payload (sizeof(struct ql_vnd_stat_entry)) but copies it into an 8-byte struct ql_vnd_tgt_stats_param. Every accepted QL_VND_GET_TGT_STATS request therefore writes 8 bytes of caller data past the end of the allocation, which can corrupt adjacent slab memory. The handler only uses tgt_id and stat_type, so copy just sizeof(*req_data) bytes. Keep the length check so that the 16-byte requests user space sends today are still accepted. Found by a static analysis tool. The fix and this changelog were drafted with AI assistance (Claude Code, with a second review by OpenAI Codex), then reviewed by the submitter. Fixes: dbf1f53cfd23 ("scsi: qla2xxx: Implementation to get and manage host, target stats and initiator port") Cc: stable@vger.kernel.org Signed-off-by: Zijie Zhao --- Testing: - Compile-tested on x86_64 (allmodconfig, W=1): drivers/scsi/qla2xxx/qla_bsg.o; no new warnings. - checkpatch.pl --strict: no errors or warnings. --- drivers/scsi/qla2xxx/qla_bsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index ab559048dbb8..65dbe71ff309 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c @@ -3258,7 +3258,7 @@ qla2x00_get_tgt_stats(struct bsg_job *bsg_job) /* Copy the request buffer in req_data */ sg_copy_to_buffer(bsg_job->request_payload.sg_list, bsg_job->request_payload.sg_cnt, - req_data, req_data_len); + req_data, sizeof(*req_data)); response_len = sizeof(struct ql_vnd_tgt_stats_resp) + sizeof(struct ql_vnd_stat_entry); --- base-commit: 4be084ac36f95f95e21a1e39207e87326967a73d change-id: 20261201-kbug-l941-4a769b0d018c Best regards, -- Zijie Zhao