8560 Commits

Author SHA1 Message Date
Gleb Chesnokov
42667fe80d scst_lib: Fix handling of a SENSE with buffer size 0
Sending a REQUEST_SENSE with a buffer size 0 to the LUN that does not
exist causes the following kernel panic:

RIP: 0010:sg_init_table+0x1e/0x30
Call Trace:
  scst_alloc_sg+0xc3/0x270 [scst]
  scst_set_cmd_error+0x803/0xa40 [scst]
  __scst_init_cmd+0x5c3/0xb80 [scst]
  scst_cmd_init_done+0x142/0xae0 [scst]
  cmnd_rx_start+0x7f5/0x13d0 [iscsi_scst]
  isert_pdu_rx+0x54/0x140 [isert_scst]
  isert_recv_completion_handler+0x498/0x580 [isert_scst]
  isert_poll_cq+0x396/0x800 [isert_scst]
  isert_cq_comp_work_cb+0x4a/0x120 [isert_scst]
  process_one_work+0x1d1/0x410
  worker_thread+0x2b/0x3d0
  kthread+0x11a/0x130
  ret_from_fork+0x1f/0x40

Hence set bufflen to 18 if a buffer size 0 was passed to avoid the
crash.

Reported-by: Lev Vainblat <lev@zadarastorage.com>
2022-10-24 13:05:05 +03:00
Gleb Chesnokov
72ce39b89d scst_lib: Fix handling of an INQUIRY with buffer size 0
Sending an INQUIRY with a buffer size 0 to the LUN that does not exist
causes the following kernel panic:

RIP: 0010:sg_init_table+0x1e/0x30
Call Trace:
  scst_alloc_sg+0xc3/0x270 [scst]
  scst_set_cmd_error+0x8c9/0xa80 [scst]
  __scst_init_cmd+0x5c3/0xb80 [scst]
  scst_cmd_init_done+0x142/0xae0 [scst]
  cmnd_rx_start+0x7f5/0x13d0 [iscsi_scst]
  isert_pdu_rx+0x54/0x140 [isert_scst]
  isert_recv_completion_handler+0x498/0x580 [isert_scst]
  isert_poll_cq+0x396/0x800 [isert_scst]
  isert_cq_comp_work_cb+0x4a/0x120 [isert_scst]
  process_one_work+0x1d1/0x410
  worker_thread+0x2b/0x3d0
  kthread+0x11a/0x130
  ret_from_fork+0x1f/0x40

Hence set bufflen to 36 if a buffer size 0 was passed to avoid the
crash.

Reported-by: Lev Vainblat <lev@zadarastorage.com>
2022-10-24 13:04:59 +03:00
Gleb Chesnokov
9ff19d0b15 scst/include/backport.h: Fix the build against CentOS 8-stream
Fixes: https://github.com/SCST-project/scst/issues/77
2022-09-15 12:19:00 +03:00
Gleb Chesnokov
284ec37664 scst_vdisk: Unbreak the RHEL 9 build 2022-07-11 23:52:51 +03:00
Gleb Chesnokov
67a5f642e6 scst_vdisk: Fix build on RHEL 8.6
Reported-by: Gilbert Standen <gilstanden@hotmail.com>

Fixes: https://github.com/SCST-project/scst/issues/45
2022-05-16 12:27:11 +03:00
Gleb Chesnokov
6b419bde6b github: Change mail server for mail notification action
Google no longer support the use of third-party apps or devices which
ask you to sign in to your Google Account using only your username and
password. This causes problems when using github mail notification action
to send SCST patches. Hence, change the Google mail server to an another one.
2022-05-15 16:13:55 +03:00
Gleb Chesnokov
b4fcdb7349 scst: Port to Linux kernel v5.17 2022-03-24 13:46:11 +03:00
Gleb Chesnokov
1e40ce12bd scst_event: Fix check of recopied payload_len
We check the recopied payload_len with the length of
struct scst_event + payload.

  if (event->payload_len != event_len)

This check will never succeed.

So check the recopied payload length with the passed
payload_len from user space.

Fixes: ffd85476 ("scst: Suppress a false positive Coverity memory corruption complaint")
2022-02-15 14:00:06 +03:00
Gleb Chesnokov
e14239d495 scst_event: Fix crash when copying an event from user space
We copy struct scst_event with the payload from user space, but
use event_entry_len as the length of this buffer.

event_entry_len contains the length of struct scst_event_entry and
the payload. struct scst_event is part of struct scst_event_entry
and is therefore shorter in length.

Thus, use the length of struct scst_event + payload when
copying the event from user space.

This patch should fix the following bug:

usercopy: Kernel memory overwrite attempt detected to SLUB object 'kmalloc-512' (offset 232, size 296)!
------------[ cut here ]------------
kernel BUG at mm/usercopy.c:102!
...
RIP: 0010:usercopy_abort+0x74/0x76
Call Trace:
__check_heap_object+0xd3/0x100
__check_object_size+0xff/0x16b
scst_event_get_event_from_user+0xbb/0x2e0 [scst]
scst_event_ioctl+0x5f1/0xde0 [scst]
do_vfs_ioctl+0xa4/0x680
? syscall_trace_enter+0x1d3/0x2c0
ksys_ioctl+0x60/0x90
__x64_sys_ioctl+0x16/0x20
do_syscall_64+0x5b/0x1a0
entry_SYSCALL_64_after_hwframe+0x65/0xca

Fixes: ffd85476 ("scst: Suppress a false positive Coverity memory corruption complaint")
Fixes: https://github.com/SCST-project/scst/issues/25
2022-02-15 14:00:04 +03:00
Chesnokov Gleb
307835218c github: Improve the listing of modified files for the Mailing list action
Use --stat option instead of --name-only for the 'Get list of files' step,
as it also provides stats on modified files.
2022-02-15 13:59:45 +03:00
Chesnokov Gleb
e6f66a4401 Update stable branch version for github Mailing list action 2022-01-12 14:07:54 +03:00
Chesnokov Gleb
1ae2fb3a47 Add a list of files per commit for github Mailing list action 2022-01-11 17:36:02 +03:00
Bart Van Assche
ff09b47b1a Makefile: Include the debian directory in the source code archive v3.6 2022-01-02 20:27:28 -08:00
Bart Van Assche
490abadac2 scripts/list-source-files: Improve the exclusion filter
Also exclude the files generated by the kernel v5.15 build system.
Additionally, sort the output and fix shellcheck warnings.
2022-01-02 20:27:28 -08:00
Bart Van Assche
dd8bef0f4c nightly build: Update kernel versions 2022-01-01 20:15:20 -08:00
Bart Van Assche
250588cb36 www: Update the version number from 3.5 to 3.6
Additionally, change the link to the SourceForge download page into a link
to the github tags page. That page has "Download ZIP" and "Download tar.gz"
buttons.
2021-12-29 19:29:35 -08:00
Bart Van Assche
9c5406664a Bump the version number to 3.6.0
These changes have been generated by running the following command:

$ scripts/update-version 3 6 0
2021-12-29 19:19:14 -08:00
Bart Van Assche
1f0c29575d scst/ChangeLog: Mention that the iSER target driver is now compatible with hardened usercopy 2021-12-22 20:15:05 -08:00
Bart Van Assche
a00d813a03 www: Change 'SCST Git' into 'SCST Git repository'
Additionally, remove the reference to the SVN repository from the FCoE
driver documentation.
2021-12-22 20:06:03 -08:00
Bart Van Assche
2f0a5426d0 qla2x00t/doc/qla2x00t-howto.html: Make this document HTML-compliant 2021-12-22 20:03:06 -08:00
Bart Van Assche
47f5a89f3e qla2x00t/doc/Makefile: Add to repository 2021-12-22 20:02:45 -08:00
Chesnokov Gleb
efe085fb0d www: Update SCST repository link
We are migrating to GitHub, so update SCST repository link
to the new git repository.
2021-12-22 19:34:11 +03:00
Chesnokov Gleb
1a7f2dd9ce www/downloads.html: Update the information about repository
We are migrating to GitHub, so update the information about the new
git repository.
2021-12-22 19:34:11 +03:00
Chesnokov Gleb
e807b8e466 INSTALL.md: Update dkms packages information 2021-12-21 14:23:06 +03:00
Chesnokov Gleb
e9c9cc8b6a Makefile: Introduce the 'make rpm-dkms'
For convenience, there is a lack of opportunity to build
the SCST dkms and scstadmin packages in a one command.

Introduce the 'make rpm-dkms' command that in similar way to 'make rpm'
builds SCST dkms rpm packages and then builds scstadmin rpm packages.
2021-12-21 14:23:06 +03:00
Bart Van Assche
f1a0222f2b INSTALL.md: Use markdown formatting 2021-12-19 20:09:02 -08:00
Bart Van Assche
f9e7878ddf INSTALL.md: Restrict to 80 columns 2021-12-19 20:07:29 -08:00
Bart Van Assche
e9df0ad95b www: Improve HTML conformance
Change &amp into &amp;. Insert &nbsp; in empty spans. Add summary="" to
tables. Change height="..." into style="height: ..." for table data.
2021-12-19 20:06:24 -08:00
Bart Van Assche
6dd60c4bb1 www/Makefile: Add this file to the repository
Make it easy to check HTML-compliance of the SCST website.
2021-12-19 20:06:24 -08:00
Gilbert Standen
53d5d68f01 Update INSTALL.md 2021-12-19 20:04:34 -08:00
Bart Van Assche
39f5c343b8 scst/ChangeLog: Summarize the changes for the upcoming 3.6 release 2021-12-17 15:51:20 -08:00
Chesnokov Gleb
50d607a336 isert-scst: Enable copying to user space from isert_cmnd_cache
This patch fixes warning with call trace that occurs during
copy_to_user() from isert_read():

usercopy: Kernel memory exposure attempt detected from SLUB object 'sgv-clust-64K' (offset 200, size 48)!
------------[ cut here ]------------
kernel BUG at mm/usercopy.c:99!
...
RIP: 0010:usercopy_abort+0x7b/0x7d
Call Trace:
 __check_heap_object+0xdf/0x110
 __check_object_size.part.0+0x128/0x150
 __check_object_size+0x1c/0x20
 isert_read+0x10b/0x380 [isert_scst]
 ? security_file_permission+0x96/0x160
 vfs_read+0x9f/0x190
 ksys_read+0x67/0xe0
 __x64_sys_read+0x19/0x20
 do_syscall_64+0x61/0xb0
 ? __x64_sys_sendto+0x24/0x30
 ? do_syscall_64+0x6e/0xb0
 ? exit_to_user_mode_prepare+0x37/0xb0
 ? syscall_exit_to_user_mode+0x27/0x50
 ? do_syscall_64+0x6e/0xb0
 ? asm_exc_page_fault+0x8/0x30
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Signed-off-by: Morozov Ilia <morozov.i@raidix.com>
2021-12-16 00:43:44 +03:00
Chesnokov Gleb
475970f66a Minor fixes for the previous commit 2021-12-16 00:43:44 +03:00
Chesnokov Gleb
1efde3fe98 Revert "scst: Enable copying to user space from an SGV cache"
This reverts commit 0c4f769c0e.
2021-12-16 00:43:44 +03:00
Chesnokov Gleb
37de84607c Fix sender name for github Mailing list action 2021-12-15 16:43:44 +03:00
Chesnokov Gleb
3f17045397 nightly build: Update kernel versions 2021-12-14 20:49:36 +03:00
Chesnokov Gleb
a08e8b8b35 vdisk_fileio, async mode: Support multi-page sgv's for kernels < v5.1 2021-12-08 21:44:58 +03:00
Chesnokov Gleb
414805bb4d vdisk_fileio, async_mode: Fix scheduling while atomic
This patch should fix the following bug:

BUG: scheduling while atomic: ...
...
Call Trace:
 <IRQ>
 dump_stack+0x6d/0x8b
 __schedule_bug.cold.94+0x4c/0x5a
 __schedule+0x51d/0x606
 schedule+0x33/0x9a
 __lock_sock+0x7d/0xbc
 ? finish_wait+0x80/0x78
 lock_sock_nested+0x64/0x66
 do_tcp_setsockopt.isra.47+0x7d/0xbc4
 ? scst_free_cmd+0x171/0x220 [scst]
 tcp_setsockopt+0x34/0x36
 sock_common_setsockopt+0x1a/0x1c
 cmnd_tx_start+0x94/0x210 [iscsi_scst]
 iscsi_send+0x2cd/0x800 [iscsi_scst]
 iscsi_tcp_send_locally+0xe9/0x1f0 [iscsi_scst]
 ? iscsi_tcp_send_data_rsp+0x5a/0x90 [iscsi_scst]
 iscsi_xmit_response+0xfe/0x230 [iscsi_scst]
 scst_process_active_cmd+0x742/0x1740 [scst]
 ? try_to_wake_up+0x1dd/0x5ac
 scst_process_redirect_cmd+0x128/0x300 [scst]
 ? insert_work+0xa8/0xc2
 scst_cmd_done_local+0x7f/0x100 [scst]
 ? rvmio_transfer_data+0xb0/0xb0 [scst_vdisk]
 fileio_async_complete+0x46/0x100 [scst_vdisk]
 iomap_dio_complete_work+0x29/0x2e
 iomap_dio_bio_end_io+0xed/0xff
 bio_endio+0xda/0x12e
 blk_update_request+0xea/0x3a1
 scsi_end_request+0x30/0x111
 scsi_io_completion+0x7c/0x4e1
 ? virtscsi_remove+0xc0/0xc0 [virtio_scsi]
 scsi_finish_command+0xe7/0x11a
 scsi_softirq_done+0x75/0xde
 blk_done_softirq+0xa5/0xcd
 __do_softirq+0xe1/0x2e7
 ? sched_clock+0x9/0xd
 irq_exit+0xf3/0xf8
 do_IRQ+0x59/0xe0
 common_interrupt+0xf/0x1d2
 </IRQ>
RIP: 0010:native_safe_halt+0x12/0x14
...
2021-12-08 21:44:58 +03:00
Chesnokov Gleb
33b872d055 vdisk_fileio, async mode: Switch from kvec to bvec
fileio_exec_async() for fileio devices with o_direct flag triggers
the following Linux direct_io datapath:
- fileio_exec_async()      -- ... --> iomap_dio_bio_actor()
- iomap_dio_bio_actor()    -- ... --> bio_iov_iter_get_pages()
- bio_iov_iter_get_pages() -- ... --> iov_iter_get_pages()
- iov_iter_get_pages() returns -EFAULT

iov_iter_get_pages() only handles iovec and bvec iterators.
Its kvec hanlding always return -EFAULT.

We cannot use iovec because calling iov_iter_init() from
the kernel context initializes iov_iter as ITER_KVEC.

Thus, use bvecs for fileio async direct IO.

Reported-by: Lu Chang
2021-12-08 21:44:58 +03:00
Chesnokov Gleb
9d7cf27c7c Makefile: Fix the scst-rpm build
Fixes: 1cfa1e7f87 ("Makefile: switch to qla-32gbit by default")
2021-12-07 00:18:44 +03:00
Chesnokov Gleb
43aa0de32a Add a github action to send mail to the SCST mailing list upon push 2021-12-03 15:33:05 +03:00
Bart Van Assche
32fd54f3ef fcst: Fix the Debian 10 build
The line in /lib/modules/4.19.0-18-amd64/build/Makefile on Debian 10 with
the path to the header files is as follows:

MAKEARGS := -C /usr/src/linux-headers-4.19.0-18-common O=/usr/src/linux-headers-4.19.0-18-amd64

while on Debian 11 the contenst of /lib/modules/5.10.0-8-amd64/build/Makefile
is as follows:

include /usr/src/linux-headers-5.10.0-8-common/Makefile

Add support for extracting the header file directory path from the Debian
10 Makefile.

Fixes: https://github.com/bvanassche/scst/issues/52
2021-12-02 20:31:44 -08:00
Bart Van Assche
bdb099dfce Merge branch 'svn-trunk' 2021-11-30 22:00:55 -08:00
Bart Van Assche
769cb7fb26 fcst: Fix the build for Debian systems
Fixes: https://github.com/bvanassche/scst/issues/52


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9610 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-12-01 06:00:49 +00:00
Bart Van Assche
a20b6e0fae nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9609 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-11-27 04:27:14 +00:00
Bart Van Assche
2715ea074a Merge branch 'svn-trunk' 2021-11-24 17:05:04 -08:00
Bart Van Assche
876aa192c8 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9608 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-11-25 01:04:58 +00:00
Bart Van Assche
9ed4967478 scripts/run-regression-tests: Exclude LIO from the build
Additionally, use make -j to speed up compilation.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9607 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-11-25 01:04:37 +00:00
Bart Van Assche
e49a874fab Merge branch 'svn-trunk' 2021-11-24 16:39:28 -08:00
Bart Van Assche
5e313fddf4 fcst: Rework the fc_fill_fc_hdr() compatibility check
Decide which SCSI header file to include based on a compile time check instead
of trying to derive that choice from the UEK kernel version.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9606 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-11-25 00:39:17 +00:00