linux-stable/drivers/scsi/qla2xxx
Arun Easi 3ef68d4f0c scsi: qla2xxx: Fix kernel crash when accessing port_speed sysfs file
Kernel crashes when accessing port_speed sysfs file.  The issue happens on
a CNA when the local array was accessed beyond bounds. Fix this by changing
the lookup.

BUG: unable to handle kernel paging request at 0000000000004000
PGD 0 P4D 0
Oops: 0000 [#1] SMP PTI
CPU: 15 PID: 455213 Comm: sosreport Kdump: loaded Not tainted
4.18.0-305.7.1.el8_4.x86_64 #1
RIP: 0010:string_nocheck+0x12/0x70
Code: 00 00 4c 89 e2 be 20 00 00 00 48 89 ef e8 86 9a 00 00 4c 01
e3 eb 81 90 49 89 f2 48 89 ce 48 89 f8 48 c1 fe 30 66 85 f6 74 4f <44> 0f b6 0a
45 84 c9 74 46 83 ee 01 41 b8 01 00 00 00 48 8d 7c 37
RSP: 0018:ffffb5141c1afcf0 EFLAGS: 00010286
RAX: ffff8bf4009f8000 RBX: ffff8bf4009f9000 RCX: ffff0a00ffffff04
RDX: 0000000000004000 RSI: ffffffffffffffff RDI: ffff8bf4009f8000
RBP: 0000000000004000 R08: 0000000000000001 R09: ffffb5141c1afb84
R10: ffff8bf4009f9000 R11: ffffb5141c1afce6 R12: ffff0a00ffffff04
R13: ffffffffc08e21aa R14: 0000000000001000 R15: ffffffffc08e21aa
FS:  00007fc4ebfff700(0000) GS:ffff8c717f7c0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000004000 CR3: 000000edfdee6006 CR4: 00000000001706e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
  string+0x40/0x50
  vsnprintf+0x33c/0x520
  scnprintf+0x4d/0x90
  qla2x00_port_speed_show+0xb5/0x100 [qla2xxx]
  dev_attr_show+0x1c/0x40
  sysfs_kf_seq_show+0x9b/0x100
  seq_read+0x153/0x410
  vfs_read+0x91/0x140
  ksys_read+0x4f/0xb0
  do_syscall_64+0x5b/0x1a0
  entry_SYSCALL_64_after_hwframe+0x65/0xca

Link: https://lore.kernel.org/r/20210908164622.19240-7-njavali@marvell.com
Fixes: 4910b524ac ("scsi: qla2xxx: Add support for setting port speed")
Cc: stable@vger.kernel.org
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-09-14 23:33:20 -04:00
..
Kconfig
Makefile scsi: qla2xxx: edif: Add start + stop bsgs 2021-07-27 00:06:42 -04:00
qla_attr.c scsi: qla2xxx: Fix kernel crash when accessing port_speed sysfs file 2021-09-14 23:33:20 -04:00
qla_bsg.c scsi: qla2xxx: Add support for mailbox passthru 2021-09-14 23:33:19 -04:00
qla_bsg.h scsi: qla2xxx: Add support for mailbox passthru 2021-09-14 23:33:19 -04:00
qla_dbg.c scsi: qla2xxx: Changes to support FCP2 Target 2021-08-11 23:17:42 -04:00
qla_dbg.h scsi: qla2xxx: edif: Add start + stop bsgs 2021-07-27 00:06:42 -04:00
qla_def.h scsi: qla2xxx: Fix NVMe retry 2021-08-23 22:36:54 -04:00
qla_devtbl.h
qla_dfs.c scsi: qla2xxx: Remove unnecessary NULL check 2021-01-22 22:04:16 -05:00
qla_dsd.h
qla_edif.c scsi: qla2xxx: edif: Fix returnvar.cocci warnings 2021-08-23 22:36:54 -04:00
qla_edif.h scsi: qla2xxx: edif: Add N2N support for EDIF 2021-08-23 22:36:53 -04:00
qla_edif_bsg.h scsi: qla2xxx: edif: Add start + stop bsgs 2021-07-27 00:06:42 -04:00
qla_fw.h scsi: qla2xxx: edif: Add N2N support for EDIF 2021-08-23 22:36:53 -04:00
qla_gbl.h scsi: qla2xxx: Add support for mailbox passthru 2021-09-14 23:33:19 -04:00
qla_gs.c scsi: qla2xxx: Display 16G only as supported speeds for 3830c card 2021-09-14 23:33:19 -04:00
qla_init.c scsi: qla2xxx: edif: Use link event to wake up app 2021-09-14 23:33:19 -04:00
qla_inline.h scsi: qla2xxx: edif: Add N2N support for EDIF 2021-08-23 22:36:53 -04:00
qla_iocb.c scsi: qla2xxx: edif: Do secure PLOGI when auth app is present 2021-08-23 22:36:53 -04:00
qla_isr.c scsi: qla2xxx: Fix NVMe session down detection 2021-08-23 22:36:54 -04:00
qla_mbx.c scsi: qla2xxx: Add support for mailbox passthru 2021-09-14 23:33:19 -04:00
qla_mid.c scsi: qla2xxx: Fix unsafe removal from linked list 2021-08-11 23:17:56 -04:00
qla_mr.c scsi: qla2xxx: Suppress Coverity complaints about dseg_r* 2021-03-24 21:47:20 -04:00
qla_mr.h scsi: qla2xxx: Suppress Coverity complaints about dseg_r* 2021-03-24 21:47:20 -04:00
qla_nvme.c scsi: qla2xxx: Fix crash in NVMe abort path 2021-09-14 23:33:19 -04:00
qla_nvme.h SPDX patches for 5.10-rc1 2020-10-14 16:19:42 -07:00
qla_nx.c scsi: qla2xxx: Remove unused variable 'status' 2021-07-27 00:06:42 -04:00
qla_nx.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_nx2.c scsi: qla2xxx: Simplify qla8044_minidump_process_control() 2021-03-24 21:47:21 -04:00
qla_nx2.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_os.c scsi: qla2xxx: Check for firmware capability before creating QPair 2021-09-14 23:33:19 -04:00
qla_settings.h scsi/qla2xxx: Convert to SPDX license identifiers 2020-09-16 14:31:50 +02:00
qla_sup.c scsi: qla2xxx: Remove redundant continue statement in a for-loop 2021-07-18 21:31:28 -04:00
qla_target.c scsi: qla2xxx: edif: Do secure PLOGI when auth app is present 2021-08-23 22:36:53 -04:00
qla_target.h scsi: qla2xxx: edif: Add encryption to I/O path 2021-07-27 00:06:43 -04:00
qla_tmpl.c SCSI misc on 20201216 2020-12-16 13:34:31 -08:00
qla_tmpl.h scsi: qla2xxx: Fix crash during driver load on big endian machines 2020-12-09 11:34:17 -05:00
qla_version.h scsi: qla2xxx: Update version to 10.02.06.200-k 2021-08-23 22:36:54 -04:00
tcm_qla2xxx.c Merge branch '5.12/scsi-fixes' into 5.13/scsi-staging 2021-04-05 22:57:29 -04:00
tcm_qla2xxx.h