Skip to content

Commit 91b3d9f

Browse files
shivasharan-smartinkpetersen
authored andcommitted
scsi: megaraid_sas: Check valid aen class range to avoid kernel panic
Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: Shivasharan S <[email protected]> Cc: [email protected] Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Tomas Henzl <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 8823abe commit 91b3d9f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5651,6 +5651,14 @@ megasas_register_aen(struct megasas_instance *instance, u32 seq_num,
56515651
prev_aen.word =
56525652
le32_to_cpu(instance->aen_cmd->frame->dcmd.mbox.w[1]);
56535653

5654+
if ((curr_aen.members.class < MFI_EVT_CLASS_DEBUG) ||
5655+
(curr_aen.members.class > MFI_EVT_CLASS_DEAD)) {
5656+
dev_info(&instance->pdev->dev,
5657+
"%s %d out of range class %d send by application\n",
5658+
__func__, __LINE__, curr_aen.members.class);
5659+
return 0;
5660+
}
5661+
56545662
/*
56555663
* A class whose enum value is smaller is inclusive of all
56565664
* higher values. If a PROGRESS (= -1) was previously

0 commit comments

Comments
 (0)