Commit Graph

9171 Commits

Author SHA1 Message Date
Gleb Chesnokov
44bd290fea scst: Add RHEL 8.10 and 9.6 kernel support
Add compatibility for RHEL 8.10 and RHEL 9.6 kernels. Update nightly build
and regression test configs, and adjust version checks in the codebase
to handle changes in these new RHEL kernel releases.
2025-05-26 17:37:09 +03:00
Gleb Chesnokov
ac41d325f3 scst: Fix backport for stable, RHEL, and UEK kernels
Update backport logic to support recent stable, RHEL, and UEK kernel
versions. Adjust version checks and compatibility for sysfs_emit,
timer_delete, and related helpers.

Fixes: 0e8fdad5e4 ("scst: Use sysfs_emit/sysfs_emit_at instead of scnprintf()")
Fixes: d21b6f1457 ("scst: Port to Linux kernel v6.15")
2025-05-26 17:37:09 +03:00
Gleb Chesnokov
15695fedce nightly build: Update kernel versions
Another kernel versions update
2025-05-26 17:37:09 +03:00
Gleb Chesnokov
fdbb34c77e .github/workflows: Improve regression test failure detection in GitHub Actions
Update the run_regression_tests workflow to fail if "Compiling the patched
kernel" is missing or if any non-zero error count ("N errors") or "FAILED"
is detected after the marker.

The previous check missed multi-digit error counts and did not handle
a missing marker, which could result in undetected failures.
2025-05-26 17:37:09 +03:00
Gleb Chesnokov
707554a310 scst: Revert semantic kernel version change
Partially revert the earlier commit which limited SCST_KVER to a semantic
version only. Restore usage of the full kernel version string for improved
clarity in build metadata.

Fixes: ac1e7f82b7 ("scst: Fix SCST_KVER to use semantic version only")
2025-05-21 11:34:29 +03:00
Gleb Chesnokov
977904d33a scst: Use separate sysfs_emit_at() for emitting SCST_SYSFS_KEY_MARK
Replace combined sysfs_emit() calls with separate sysfs_emit() and
sysfs_emit_at() invocations when emitting SCST_SYSFS_KEY_MARK in sysfs
attribute show handlers.

This improves code clarity and consistency, explicitly handling the
conditional addition of SCST_SYSFS_KEY_MARK.

This patch does not change any functionality.
2025-05-19 20:46:54 +03:00
Gleb Chesnokov
0e8fdad5e4 scst: Use sysfs_emit/sysfs_emit_at instead of scnprintf()
Replace scnprintf() with sysfs_emit() and sysfs_emit_at() in sysfs show handlers.

These helper functions are specifically designed for sysfs output, providing safer
handling of buffer lengths and consistency across kernel sysfs interfaces.

This patch does not change any functionality.
2025-05-19 20:46:54 +03:00
Gleb Chesnokov
989802f48d scst: Replace snprintf() with scnprintf()
Replace snprintf() with scnprintf() in two places:

- code paths that build up a buffer incrementally
- sysfs attribute “show” handlers

scnprintf() guarantees its return value is the number of bytes actually
written (never exceeding the buffer), preventing potential overruns.

This patch does not change any functionality.
2025-05-19 20:46:54 +03:00
Gleb Chesnokov
7cdf85e663 scst_debug: Fix multiple checkpatch warnings
This patch does not change any functionality.
2025-05-19 20:46:54 +03:00
Gleb Chesnokov
ac1e7f82b7 scst: Fix SCST_KVER to use semantic version only
Previously, SCST_KVER included the full kernel release string. This patch
limits it to the semantic version (e.g. "6.9.0") for cleaner and more
consistent output in dmesg, sysfs, and modinfo.

Fixes: 6782003bfc ("scst: Extend build metadata passed to the SCST")
2025-05-16 17:33:33 +03:00
Gleb Chesnokov
6782003bfc scst: Extend build metadata passed to the SCST
Previously, only the revision string was passed from the build system
into the SCST kernel module. This patch extends that by passing additional
build metadata: kernel version, build date, Git commit hash, build number,
and architecture type.

These values are now consistently exposed in the kernel log, sysfs,
and via modinfo, providing a unified and reliable way to identify the
exact build in use.
2025-05-16 16:37:43 +03:00
Gleb Chesnokov
9cbca53830 scst: Replace sprintf() with scnprintf() in sysfs callbacks
Replace all uses of sprintf() with scnprintf() in sysfs attribute
callbacks to eliminate the risk of buffer overflows.

This patch does not change any functionality.
2025-05-16 16:37:43 +03:00
Gleb Chesnokov
4ce8735a92 scst_sysfs: Fix multiple checkpatch warnings
This patch does not change any functionality.
2025-05-16 16:37:43 +03:00
Gleb Chesnokov
e81277e8dc scst_const.h, scst_priv.h: Fix multiple checkpatch warnings
This patch does not change any functionality.
2025-05-16 16:37:43 +03:00
Gleb Chesnokov
949f5ef99c scst_main: Fix multiple checkpatch warnings
This patch does not change any functionality.
2025-05-16 16:37:43 +03:00
Gleb Chesnokov
a410829b26 scst_vdisk: Port to Linux kernel v6.15
Support for the following block layer changes in the Linux kernel v6.15:

- 105ca2a2c2ff ("block: split struct bio_integrity_payload")
2025-05-14 18:36:46 +03:00
Gleb Chesnokov
163eb9dcc1 scst: Port to Linux kernel v6.15
Support for the following scsi layer changes in the Linux kernel v6.15:

- 0ea163a18b17 ("scsi: usb: Rename the RESERVE and RELEASE constants")
2025-05-14 18:36:46 +03:00
Gleb Chesnokov
d21b6f1457 scst: Port to Linux kernel v6.15
Support for the following changes in the Linux kernel v6.15:

- 8fa7292fee5c ("treewide: Switch/rename to timer_delete[_sync]()")
2025-05-14 18:36:46 +03:00
Gleb Chesnokov
cc1e66a0e1 qla2x00t-32gbit: Mark device strings as nonstring
In preparation for memtostr*() checking that its source is marked as
nonstring, annotate the device strings accordingly.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> # SCSI
Signed-off-by: Kees Cook <kees@kernel.org>
[ commit 88a157a3204d upstream ]
2025-05-14 13:49:18 +03:00
Gleb Chesnokov
b9f56d6d16 qla2x00t-32gbit: Fix typos in a comment
Fix typos in a comment.

hapens -> happens
recommeds -> recommends

Signed-off-by: Yuichiro Tsuji <yuichtsu@amazon.com>
Link: https://lore.kernel.org/r/20250224075907.2505-1-yuichtsu@amazon.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 0107fb8686b2 upstream ]
2025-05-14 13:49:18 +03:00
Gleb Chesnokov
d8db7deb2b Makefile: Actualise help target
Sync the `help` target with the actual Makefile rules:

- Include missing targets (tags, cov-build, docs, scstadm, scstadm-rpm)
- Reorder and align target groups
- Update `.PHONY` list
2025-04-21 14:22:43 +03:00
Gleb Chesnokov
c934aee1a8 Makefile, specs: Honour %{_sbindir} for helper tools
Fedora 42 maps %{_sbindir} to /usr/bin. Export SBINDIR=%{_sbindir} in
the spec files and let the iscsi-scst/scstadmin Makefiles honour that
variable.

Fixes "File not found: .../iscsi-scst-adm" on unified-/usr systems while
keeping older distros unchanged.
2025-04-18 18:54:20 +03:00
Gleb Chesnokov
ef37ad252c scst_lib: Mark devkey string as nonstring
Fix the following GCC 15 warnings:

    initializer-string for array of ‘unsigned char’ truncates NUL
    terminator but destination lacks ‘nonstring’ attribute
    (17 chars into 16 available)

This patch doesn't change any functionality.
2025-04-18 18:54:20 +03:00
Gleb Chesnokov
f32f464190 iscsi-scstd: Fix redefinition of bool when building with GCC 15
GCC 15 (C23) now reserves bool/true/false, so the local typedef in
iscsid.d breaks the build:

    error: cannot use keyword 'false' as enumeration constant
    error: expected ';', identifier or '(' before 'bool'

Include <stdbool.h> and drop the typedef.
2025-04-18 18:54:20 +03:00
Gleb Chesnokov
86d3d4bb1d kbuild: Enable additional compiler warnings
Add additional compiler flags to improve code compliance.
2025-03-25 18:57:32 +03:00
Gleb Chesnokov
12a00ffc89 nightly build: Update kernel versions
Another kernel versions update
2025-03-25 18:57:32 +03:00
Gleb Chesnokov
d09f360b93 scripts: Fix shellcheck warnings for checkpatch scripts
- Switching from 'set -e' to 'set -euo pipefail' for better error handling.
- Quoting all variable expansions to prevent word splitting and globbing.
- Replacing legacy unquoted $(...) and $@ with quoted forms.
- Using array-safe idioms where necessary (e.g., "${src_files[@]}").

This patch doesn't change any functionality.
2025-03-25 18:57:32 +03:00
Gleb Chesnokov
2e92bd0bb3 qla2x00t-32gbit: Move FCE Trace buffer allocation to user control
Currently FCE Tracing is enabled to log additional ELS events. Instead,
user will enable or disable this feature through debugfs.

Modify existing DFS knob to allow user to enable or disable this
feature.

echo [1 | 0] > /sys/kernel/debug/qla2xxx/qla2xxx_??/fce
cat  /sys/kernel/debug/qla2xxx/qla2xxx_??/fce

Cc: stable@vger.kernel.org
Fixes: df613b96077c ("[SCSI] qla2xxx: Add Fibre Channel Event (FCE) tracing support.")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20241115130313.46826-4-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 841df27d619e upstream ]
2025-03-25 17:19:08 +03:00
Gleb Chesnokov
a2c1c2d8b2 qla2x00t, qla2x00t-32gbit, scst_local: Port to Linux kernel v6.14
Support for the following scsi layer changes in the Linux kernel v6.14:

- ed638918f4df ("scsi: Rename .slave_alloc() and .slave_destroy()")
- 49515b7fe50c ("scsi: Convert SCSI drivers to .sdev_configure()")
- c9a71ca13f71 ("scsi: Constify struct pci_device_id")
- bd326a5ad639 ("scsi: replace blk_mq_pci_map_queues with blk_mq_map_hw_queues")
2025-03-25 16:53:57 +03:00
Gleb Chesnokov
1f40850809 scst_lib: Port to Linux kernel v6.14
Support for the following block layer changes in the Linux kernel v6.14:

- 6aeb4f836480 ("block: remove bio_add_pc_page")
2025-03-25 16:53:57 +03:00
Gleb Chesnokov
191a74d127 scst: Fix recently introduced Coverity warnings
Add error handling for recently introduced SHA256 and SHA3-256 APIs.
2025-03-25 16:09:35 +03:00
Brian M
146d79ec88 iscsi-scst: Add SHA256 and SHA3-256 support to CHAP
Use the kernel userspace AL_ALG API to access additional hash
functions "sha256" and "sha3-256".

If configured for CHAP, on iSCSI login the client will present an
ordered list of desired algorithms.  During this negotiation, if
the client requests SHA256 or SHA3-256 we verify that the kernel
supports the algorithm before agreeing to use it.
2025-02-03 11:16:24 +03:00
Brian M
6c5e8ad16a iscsi-scst: Add transport name to sys entry for connection
This will make it possible to distinguish iSCSI-TCP connections
from iSER connections.
2025-01-29 13:00:08 +03:00
Gleb Chesnokov
3e3c2e6930 nightly build: Update kernel versions
Another kernel versions update
2025-01-20 18:54:10 +03:00
Gleb Chesnokov
f52ae117b8 scst: Port to Linux kernel v6.13
Support for the following changes in the Linux kernel v6.13:

- cdd30ebb1b9f ("module: Convert symbol namespace to string literal")

Fixes: https://github.com/SCST-project/scst/issues/273
2025-01-20 18:54:10 +03:00
Gleb Chesnokov
84179fa135 qla2x00t, qla2x00t-32gbit: Fix the RHEL 9.5 build
Fixes: https://github.com/SCST-project/scst/issues/272
2025-01-20 18:54:10 +03:00
Gleb Chesnokov
ddd7f084c8 .github/workflows: Update stable branch version 2024-12-28 17:14:54 +03:00
Gleb Chesnokov
2bdc19a61f Bump the version number to 3.10.0-pre
These changes have been generated by running the following command:

$ scripts/update-version 3 10 0 -pre
2024-12-28 17:14:54 +03:00
Gleb Chesnokov
ee5a0e2293 www: Update the version number from 3.8 to 3.9 v3.9 2024-12-28 16:44:09 +03:00
Gleb Chesnokov
a68cb8e94d Bump the version number to 3.9.0
These changes have been generated by running the following command:

$ scripts/update-version 3 9 0
2024-12-28 16:44:09 +03:00
Gleb Chesnokov
6325ba84ae scst/ChangeLog: Summarize the changes for the upcoming 3.9 release 2024-12-28 16:44:09 +03:00
Gleb Chesnokov
f86d0cafc0 qla2x00t-32gbit: Update version to 10.02.09.400-k
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20241115130313.46826-8-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 35002a8ec557 upstream ]
2024-12-28 16:31:52 +03:00
Gleb Chesnokov
e711206758 qla2x00t-32gbit: Supported speed displayed incorrectly for VPorts
The fc_function_template for vports was missing the
.show_host_supported_speeds. The base port had the same.

Add .show_host_supported_speeds to the vport template as well.

Cc: stable@vger.kernel.org
Fixes: 2c3dfe3f6ad8 ("[SCSI] qla2xxx: add support for NPIV")
Signed-off-by: Anil Gurumurthy <agurumurthy@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20241115130313.46826-7-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit e4e268f898c8 upstream ]
2024-12-28 16:31:52 +03:00
Gleb Chesnokov
a9cbb4e5a5 qla2x00t-32gbit: Fix NVMe and NPIV connect issue
NVMe controller fails to send connect command due to failure to locate
hw context buffer for NVMe queue 0 (blk_mq_hw_ctx, hctx_idx=0). The
cause of the issue is NPIV host did not initialize the vha->irq_offset
field.  This field is given to blk-mq (blk_mq_pci_map_queues) to help
locate the beginning of IO Queues which in turn help locate NVMe queue
0.

Initialize this field to allow NVMe to work properly with NPIV host.

 kernel: nvme nvme5: Connect command failed, errno: -18
 kernel: nvme nvme5: qid 0: secure concatenation is not supported
 kernel: nvme nvme5: NVME-FC{5}: create_assoc failed, assoc_id 2e9100 ret 401
 kernel: nvme nvme5: NVME-FC{5}: reset: Reconnect attempt failed (401)
 kernel: nvme nvme5: NVME-FC{5}: Reconnect attempt in 2 seconds

Cc: stable@vger.kernel.org
Fixes: f0783d43dde4 ("scsi: qla2xxx: Use correct number of vectors for online CPUs")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20241115130313.46826-6-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 4812b7796c14 upstream ]
2024-12-28 16:31:52 +03:00
Gleb Chesnokov
2d8d55c2de qla2x00t-32gbit: Remove check req_sg_cnt should be equal to rsp_sg_cnt
Firmware supports multiple sg_cnt for request and response for CT
commands, so remove the redundant check. A check is there where sg_cnt
for request and response should be same. This is not required as driver
and FW have code to handle multiple and different sg_cnt on request and
response.

Cc: stable@vger.kernel.org
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20241115130313.46826-5-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 833c70e212fc upstream ]
2024-12-28 16:31:52 +03:00
Gleb Chesnokov
767717c5dd qla2x00t-32gbit: Fix use after free on unload
System crash is observed with stack trace warning of use after
free. There are 2 signals to tell dpc_thread to terminate (UNLOADING
flag and kthread_stop).

On setting the UNLOADING flag when dpc_thread happens to run at the time
and sees the flag, this causes dpc_thread to exit and clean up
itself. When kthread_stop is called for final cleanup, this causes use
after free.

Remove UNLOADING signal to terminate dpc_thread.  Use the kthread_stop
as the main signal to exit dpc_thread.

[596663.812935] kernel BUG at mm/slub.c:294!
[596663.812950] invalid opcode: 0000 [#1] SMP PTI
[596663.812957] CPU: 13 PID: 1475935 Comm: rmmod Kdump: loaded Tainted: G          IOE    --------- -  - 4.18.0-240.el8.x86_64 #1
[596663.812960] Hardware name: HP ProLiant DL380p Gen8, BIOS P70 08/20/2012
[596663.812974] RIP: 0010:__slab_free+0x17d/0x360

...
[596663.813008] Call Trace:
[596663.813022]  ? __dentry_kill+0x121/0x170
[596663.813030]  ? _cond_resched+0x15/0x30
[596663.813034]  ? _cond_resched+0x15/0x30
[596663.813039]  ? wait_for_completion+0x35/0x190
[596663.813048]  ? try_to_wake_up+0x63/0x540
[596663.813055]  free_task+0x5a/0x60
[596663.813061]  kthread_stop+0xf3/0x100
[596663.813103]  qla2x00_remove_one+0x284/0x440 [qla2xxx]

Cc: stable@vger.kernel.org
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20241115130313.46826-3-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 07c903db0a2f upstream ]
2024-12-28 16:31:52 +03:00
Gleb Chesnokov
bbb412cc39 qla2x00t-32gbit: Fix abort in bsg timeout
Current abort of bsg on timeout prematurely clears the
outstanding_cmds[]. Abort does not allow FW to return the IOCB/SRB. In
addition, bsg_job_done() is not called to return the BSG (i.e. leak).

Abort the outstanding bsg/SRB and wait for the completion. The
completion IOCB will wake up the bsg_timeout thread. If abort is not
successful, then driver will forcibly call bsg_job_done() and free the
srb.

Err Inject:

 - qaucli -z
 - assign CT Passthru IOCB's NportHandle with another initiator
   nport handle to trigger timeout.  Remote port will drop CT request.
 - bsg_job_done is properly called as part of cleanup

kernel: qla2xxx [0000:21:00.1]-7012:7: qla2x00_process_ct : 286 : Error Inject.
kernel: qla2xxx [0000:21:00.1]-7016:7: bsg rqst type: FC_BSG_HST_CT else type: 101 - loop-id=1 portid=fffffa.
kernel: qla2xxx [0000:21:00.1]-70bb:7: qla24xx_bsg_timeout CMD timeout. bsg ptr ffff9971a42f0838 msgcode 80000004 vendor cmd fa010000
kernel: qla2xxx [0000:21:00.1]-507c:7: Abort command issued - hdl=4b, type=5
kernel: qla2xxx [0000:21:00.1]-5040:7: ELS-CT pass-through-ct pass-through error hdl=4b comp_status-status=0x5 error subcode 1=0x0 error subcode 2=0xaf882e80.
kernel: qla2xxx [0000:21:00.1]-7009:7: qla2x00_bsg_job_done: sp hdl 4b, result=70000 bsg ptr ffff9971a42f0838
kernel: qla2xxx [0000:21:00.1]-802c:7: Aborting bsg ffff9971a42f0838 sp=ffff99760b87ba80 handle=4b rval=0
kernel: qla2xxx [0000:21:00.1]-708a:7: bsg abort success. bsg ffff9971a42f0838 sp=ffff99760b87ba80 handle=0x4b
kernel: qla2xxx [0000:21:00.1]-7012:7: qla2x00_process_ct : 286 : Error Inject.
kernel: qla2xxx [0000:21:00.1]-7016:7: bsg rqst type: FC_BSG_HST_CT else type: 101 - loop-id=1 portid=fffffa.
kernel: qla2xxx [0000:21:00.1]-70bb:7: qla24xx_bsg_timeout CMD timeout. bsg ptr ffff9971a42f43b8 msgcode 80000004 vendor cmd fa010000
kernel: qla2xxx [0000:21:00.1]-7012:7: qla_bsg_found : 2206 : Error Inject 2.
kernel: qla2xxx [0000:21:00.1]-802c:7: Aborting bsg ffff9971a42f43b8 sp=ffff99762c304440 handle=5e rval=5
kernel: qla2xxx [0000:21:00.1]-704f:7: bsg abort fail.  bsg=ffff9971a42f43b8 sp=ffff99762c304440 rval=5.
kernel: qla2xxx [0000:21:00.1]-7051:7: qla_bsg_found bsg_job_done : bsg ffff9971a42f43b8 result 0xfffffffa sp ffff99762c304440.

Cc: stable@vger.kernel.org
Fixes: c449b4198701 ("scsi: qla2xxx: Use QP lock to search for bsg")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20241115130313.46826-2-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit c423263082ee upstream ]
2024-12-28 16:31:52 +03:00
Gleb Chesnokov
34b1edd045 scst.h: Fix multiple checkpatch warnings
This patch does not change any functionality.
2024-12-28 14:59:04 +03:00
Gleb Chesnokov
48120c5f6e scst_local: Fix multiple checkpatch warnings
This patch does not change any functionality.
2024-12-28 14:59:04 +03:00
Gleb Chesnokov
9728e85a5a scst_user: Fix multiple checkpatch warnings
This patch does not change any functionality.
2024-12-28 14:59:04 +03:00