Bart Van Assche
5b22c26d42
scst_vdisk: Fix a use-after-free
...
This patch fixes Coverity ID 333128.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7993 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-25 05:48:05 +00:00
Bart Van Assche
8cf079dbed
scst: Avoid that excessive data lengths cause COMPARE AND WRITE to crash
...
Avoid that running the libiscsi conformance tests triggers the following crash:
==================================================================
BUG: KASAN: wild-memory-access in sg_cmp_elem+0x1b6/0x490 [scst]
Read of size 8 at addr 0002000100000000 by task disk021_5/1231
CPU: 0 PID: 1231 Comm: disk021_5 Tainted: G O 5.0.0-rc6-dbg+ #2
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
Call Trace:
dump_stack+0x86/0xca
kasan_report.cold.3+0x5/0x3b
__asan_load8+0x54/0x90
sg_cmp_elem+0x1b6/0x490 [scst]
sg_cmp.constprop.41+0x185/0x380 [scst]
scst_cwr_read_cmd_finished+0x214/0x6d0 [scst]
scst_finish_internal_cmd+0x109/0x1d0 [scst]
scst_process_active_cmd+0x193/0x570 [scst]
scst_process_redirect_cmd+0x214/0x300 [scst]
scst_cmd_done_local+0xec/0x1f0 [scst]
fileio_async_complete+0x98/0x1b0 [scst_vdisk]
fileio_exec_async+0x3ac/0x430 [scst_vdisk]
fileio_exec_read+0x34f/0x560 [scst_vdisk]
vdev_do_job+0xf5/0x260 [scst_vdisk]
fileio_exec+0x66/0x70 [scst_vdisk]
scst_do_real_exec+0x11f/0x540 [scst]
scst_exec_check_blocking+0x14c/0x270 [scst]
scst_exec_check_sn+0x2ef/0x650 [scst]
scst_process_active_cmd+0x2d2/0x570 [scst]
scst_cmd_thread+0x1e3/0x6b0 [scst]
kthread+0x1d2/0x1f0
ret_from_fork+0x3a/0x50
==================================================================
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7992 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-24 17:53:27 +00:00
Bart Van Assche
65ad03ffd0
vdisk_fileio, async mode: Make a check more strict
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7991 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-24 17:50:55 +00:00
Bart Van Assche
6076eeaecb
vdisk_fileio, async mode: Switch back from bvec to kvec
...
The latter mode can handle SCST's multi-page sgv's fine while kernels before
v5.1 do not support multi-page bvecs.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7990 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-24 17:50:19 +00:00
Bart Van Assche
fa1336c452
scripts/run-regression-tests: Disable SELinux
...
The regression tests fail with an error message that is not related to SCST
if SELinux is enabled. Hence disable SELinux for the regression tests.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7989 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-24 16:54:04 +00:00
Bart Van Assche
96bc8d2d42
scst: Remove the kernel_write() backport
...
Remove this backport since it is not used anywhere in the SCST project.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7988 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-24 16:52:46 +00:00
Bart Van Assche
c386f64819
vdisk_fileio, async mode: Submit direct I/O with the "nowait" flag set
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7987 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-24 06:05:07 +00:00
Bart Van Assche
feb4185bcd
scst_vdisk: Follow-up for r7985
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7986 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-24 05:39:59 +00:00
Bart Van Assche
4bb9240e63
vdisk_fileio, async mode: Switch from kvec to bvec
...
This patch does not change any functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7985 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-24 05:36:46 +00:00
Bart Van Assche
fd495e26eb
scst_vdisk: Make fileio_exec_async() easier to read
...
This patch does not change any functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7984 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-24 05:27:07 +00:00
Bart Van Assche
1d3c73d422
scst_vdisk: Add a comment
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7983 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-24 05:21:06 +00:00
Bart Van Assche
f3f053fc57
vdisk_fileio: Fix asynchronous I/O handling
...
This patch avoids that SCSI WRITEs trigger weird errors with async=1.
Reported-by: Sietse van Zanen <sietse@wizdom.nu >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7982 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-24 05:18:58 +00:00
Bart Van Assche
7610407e49
scst_vdisk: Reduce the number of forward declarations
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7981 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-23 16:46:45 +00:00
Bart Van Assche
692575589a
scst_vdisk: Reduce the number of forward declarations
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7980 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-23 16:46:19 +00:00
Bart Van Assche
957b12b98d
scst_vdisk: Reduce the number of forward declarations
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7979 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-23 16:36:07 +00:00
Bart Van Assche
8f4d858ddd
scst_vdisk: Reduce the number of forward declarations
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7978 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-23 16:13:58 +00:00
Bart Van Assche
7d04876716
scst_vdisk: Reduce the number of forward declarations
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7977 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-23 16:13:30 +00:00
Bart Van Assche
0549e89c5b
scst_vdisk: Reduce the number of forward declarations
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7976 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-23 16:13:06 +00:00
Bart Van Assche
4b1e16a4de
nightly build: Update kernel versions
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7975 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-23 15:56:00 +00:00
Bart Van Assche
d20296f260
scst_vdisk: Reduce the number of forward declarations
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7974 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-22 16:52:44 +00:00
Bart Van Assche
ad75e6bc8b
scst_vdisk: Move the dev_type definitions
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7973 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-22 16:46:09 +00:00
Bart Van Assche
a6a546190c
scst_vdisk: Reduce the number of forward declarations
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7972 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-22 16:43:09 +00:00
Bart Van Assche
237b8f32ea
nightly build: Update kernel versions
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7971 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-22 15:26:38 +00:00
Bart Van Assche
4945ef6b3d
qla2x00t: Fix multiple checkpatch errors
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7970 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-21 16:25:17 +00:00
Bart Van Assche
9608cd5781
scst_pres: Make PERSISTENT RESERVE OUT ALL_TG_PT flag support remote ports
...
Instead of only iterating over local ports, also iterate over remote
ports.
Signed-off-by: Sergey Lysanov <slysanov@virtuozzo.com >
[bvanassche: edited patch title and description, introduced a helper function,
register remote ports once, added error checking]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7969 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-21 16:07:52 +00:00
Bart Van Assche
7812dd2738
scst_vdisk: Introduce the execute_async flag
...
This patch does not change any functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7968 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-19 01:41:46 +00:00
Bart Van Assche
e6fe4d8dd4
scst/README: Add a diagram that illustrates an active/non-optimized setup
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7967 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-19 01:27:49 +00:00
Bart Van Assche
50d93363e2
scst_disk: Remove forward declarations
...
This patch does not change any functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7966 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-19 01:21:37 +00:00
Bart Van Assche
0cbfed3042
scst_vdisk: Avoid duplicating the add_device parameters
...
This patch does not change any functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7965 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 22:28:25 +00:00
Bart Van Assche
f570994000
scst: Change add_device_parameters from a string into an array
...
This patch does not change any functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7964 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 22:27:04 +00:00
Bart Van Assche
9649e0af96
scst_vdisk: Add a comment
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7963 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 22:21:23 +00:00
Bart Van Assche
5dfaf65dfc
scst_vdisk: Make the 'async' attribute modifiable
...
Make it possible to change the 'async' attribute after a virtual disk
device has been created.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7962 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 22:20:58 +00:00
Bart Van Assche
589dad3997
scst: Rework the scst_data_direction enum
...
Since there is no relationship between enum dma_data_direction and the
SCST data direction enum, introduce a new enumeration type for the SCST
data direction. This patch does not change any functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7961 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 22:18:06 +00:00
Bart Van Assche
281801a266
scstadmin: Make $Version a local variable
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7960 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 01:51:36 +00:00
Bart Van Assche
906c18ae83
scstadmin: Update copyright
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7959 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 01:49:44 +00:00
Bart Van Assche
3a87185399
scstadmin: Avoid triggering Perl warnings
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7958 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 01:45:42 +00:00
Bart Van Assche
4ed48121e3
scstadmin: Update expected output of test 07
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7957 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 01:40:37 +00:00
Bart Van Assche
1eae6633b4
scstadmin: Fix Perl warnings
...
Modify those constructs that trigger warnings with 'use warnings'. This
patch does not modify any functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7956 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 01:38:14 +00:00
Bart Van Assche
9fb607fe12
scstadmin: Check $answer before using it
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7955 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 01:30:13 +00:00
Bart Van Assche
bf45a6162f
scstadmin: Add a test that causes scstadmin to display a prompt
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7954 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 01:29:40 +00:00
Bart Van Assche
b79fa94a27
scstadmin: Initialize container variables explicitly
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7953 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 00:46:27 +00:00
Bart Van Assche
a1b1a880af
scstadmin: Remove a superfluous declaration
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7952 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 00:41:48 +00:00
Bart Van Assche
bad428c615
scstadmin: Initialize container variables explicitly
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7951 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 00:40:23 +00:00
Bart Van Assche
c4cc4bdcbc
scstadmin: Avoid dereferencing variables that have the value undef
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7950 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 00:38:50 +00:00
Bart Van Assche
27d90a3563
scstadmin: Improve the consistency of test 07
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7949 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 00:34:48 +00:00
Bart Van Assche
4f762acebd
scstadmin: Set remote targets and remote rel_tgt_ids in test 07
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7948 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 00:34:03 +00:00
Bart Van Assche
f2b4c0d256
scstadmin: Restrict a source code line to 80 columns
...
This patch does not change any functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7947 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-17 22:08:58 +00:00
Bart Van Assche
2da0ddd47d
scstadmin: Avoid passing 'undef' to chomp()
...
This patch does not change any functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7946 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-17 22:07:35 +00:00
Bart Van Assche
477c49a7a6
scstadmin: Fix regression test 07
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7945 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-17 22:05:12 +00:00
Bart Van Assche
d5c1e5ba79
scstadmin: Use defined() instead of !... eq '' to check whether arguments have been specified
...
This patch does not change any functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7944 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-17 19:33:44 +00:00