summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* iscsid: set PR_SET_IO_FLUSHERprctl-flusher-supportMike Christie2021-07-281-0/+14
| | | | | | | | | | | | | When iscsid makes syscalls that lead to memory allocations the kernel might use GFP_KERNEL. This can lead to pages being written to iscsi disks managed by iscsid. If we are doing a syscall to try and reconnect the session the disk is accessed through then we could deadlock. When in the iscsi layer we can select our GFP flags but when making syscalls to the network layer we have to set PR_SET_IO_FLUSHER so we use the correct GFP flags. Signed-off-by: Mike Christie <michael.christie@oracle.com>
* Merge pull request #268 from gonzoleeman/add-qede-offload-supportLee Duncan2021-07-201-0/+8
|\ | | | | Support the "qede" CNA-card driver.
| * Support the "qede" CNA-card driver.Lee Duncan2021-07-201-0/+8
| | | | | | | | The iscsi_offload command needs to recognize the "qede" driver.
* | Merge pull request #265 from cleech/for_upstreamLee Duncan2021-06-171-2/+2
|\ \ | | | | | | iscsistart: fix null pointer deref before exit
| * | iscsistart: fix null pointer deref before exitChris Leech2021-06-161-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | Fixes regression caused by "open-iscsi: Clean user_param list when process exit" Which is a shame, as not freeing a memory at process exit doesn't really hurt anything. Same change as "Fix iscsiadm segfault when exiting" applied to iscsiadm. Fixes: b532ad67d495d42026165a26515c645995d23f18 Signed-off-by: Chris Leech <cleech@redhat.com>
* | Merge pull request #264 from gonzoleeman/fw-discovery-onboot-fixLee Duncan2021-05-121-0/+6
|\ \ | |/ |/| Set default 'startup' to 'onboot' for FW nodes
| * Set default 'startup' to 'onboot' for FW nodesLee Duncan2021-05-111-0/+6
|/ | | | | | | | | | When "iscsiadm -m discovery -t fw" is ran, nodes are created/updated in the node DB for each firmware target found, but the 'startup' mode values are left as 'manual', when in fact firmware nodes are treated as if this value is 'onboot'. So to keep the node DB in sync with behavior, set these to 'onboot' by default. This should *not* effect any other functionality.
* Merge pull request #261 from gonzoleeman/add-fw-async-loginLee Duncan2021-04-282-11/+17
|\ | | | | Add iscsiadm "no wait" option for firmware login.
| * Add iscsiadm "no wait" option for firmware login.Lee Duncan2021-04-272-11/+17
|/ | | | | In addition, update the iscsiadm help message, and the iscsiadm man page.
* Merge pull request #260 from gulams/masterLee Duncan2021-04-251-1/+2
|\ | | | | Check ISCSI_ERR_ISCSID_NOTCONN in iscsistart login
| * Check ISCSI_ERR_ISCSID_NOTCONN in iscsistart logingulams2021-04-201-1/+2
|/ | | In login_session() function, we need to check for error ISCSI_ERR_ISCSID_NOTCONN also. When the login command is sent to the iscsid using iscsid_exec_req(), it will try to connect to iscsid using the function ipc_connect(). If there is an issue in iscsid or if we are not able to create the socket due to some reason, then the error ISCSI_ERR_ISCSID_NOTCONN is returned. We need to retry the login command by checking the error ISCSI_ERR_ISCSID_NOTCONN.
* Merge pull request #259 from gulams/masterLee Duncan2021-04-191-1/+1
|\ | | | | Log error message when auth debug status is set
| * Log error message when auth debug status is setgulams2021-04-161-1/+1
|/ | | Log the correct error message in /var/log/messages when the debug status is set when there is an authentication error. The change is made in check_security_stage_status() function. This issue was identified when one of the customer was trying to login to the iscsi target after configuring the mutual CHAP authentication. They set the same password for both side authentication. This is not allowed as per the code as it was returning AUTH_DBG_STATUS_PASSWD_IDENTICAL. The error logged in /var/log/messages was not obvious. This change will help to understand the correct error message so that required action can be taken.
* Preparing for version 2.1.42.1.4Lee Duncan2021-03-113-2/+41
|
* Merge pull request #253 from cleech/iscsi_sessions_getChris Leech2021-03-113-13/+38
|\ | | | | Iscsi sessions get
| * libopeniscsiusr: dont error loudly if a session isn't found when working ↵Chris Leech2021-02-171-5/+16
| | | | | | | | | | | | | | | | | | | | | | through iscsi_sessions_get() Suppress the error message from iscsi_session_get when it's being called through iscsi_sessions_get now that it's not being treated as an error. There's no reason to be so alarmed the session being read in isn't specified exactly. Signed-off-by: Chris Leech <cleech@redhat.com>
| * libopeniscsiusr: skip over removed sessionsChris Leech2021-02-171-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When looping over all sessions with iscsi_sessions_get, it's possible to race against sessions being destroyed and have the sysfs attribute files be removed before they're read. Let's not treat this as an error, and simply drop the session that failed to read from the list. I think it makes sense to treat session that disapear while they're being read as if they were already gone when the sessions directory was first scanned. Apparently having iscsiadm exit with an error when trying to get a list of sessions is a problem for OpenStack deployments. Signed-off-by: Chris Leech <cleech@redhat.com>
| * libopeniscsiusr: fix error messagesChris Leech2021-02-173-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | The error message in iscsi_session_get [libopeniscsiusr/session.c:140] when a session or connection path isn't found in sysfs was failing to print the session ID, instead it printed the address of the static string for the remainder of the message ("does not exists") due to an extra comma. Additionally change all occurances of "does not exists" to "does not exist" Signed-off-by: Chris Leech <cleech@redhat.com>
* | Merge pull request #254 from gonzoleeman/iscsi-service-login-nowaitLee Duncan2021-03-112-4/+4
|\ \ | |/ |/| Enable iscsi.service asynchronous logins, cleanup services
| * Enable iscsi.service asynchronous logins, cleanup servicesLee Duncan2021-03-112-4/+4
|/ | | | | | | | | Add the "-W" (no wait) flag to the iscsiadm login command in iscsi.service, so that the service succeeds even if one or more of the targets being logged on to is not available at startup time. Also, clean up the iscsi.service and iscsid.service files.
* Merge pull request #250 from zeha/crossLee Duncan2021-02-171-3/+14
|\ | | | | Avoid hardcoding pkg-config to fix cross build
| * Avoid hardcoding pkg-config to fix cross buildHelmut Grohne2021-02-151-3/+14
|/ | | | Debian Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=982307
* Merge pull request #248 from gonzoleeman/iscsistart-timeout-fixLee Duncan2021-02-041-2/+15
|\ | | | | Fix iscsistart login issue when target is delayed.
| * Fix iscsistart login issue when target is delayed.Lee Duncan2021-02-041-2/+15
|/ | | | | | | | | | | | | | | | | | | | | Earlier commit 9258c8eae046 changed the return value fron iscsid_response() from ISCSI_ERR_ISCSID_NOTCONN to ISCSI_ERR_SESSION_NOT_CONNECTED in the case where no iscsi response is received when expected. This effected the login code in iscsistart when the target is not completely ready at iscsi login time. This commit updates iscsistart to expect the new error code, but fixing this uncovered another issue, causing iscsistart logins to continue to fail if the target returned its login response too slowly. This commit ups the timeout time for iscsistart logins from 1 second per try to 10 seconds per try. This is perhaps excessive, and a shorter delay would be more appropriate, but the retry/nanosleep logic in iscsistart meant to retry the login in such cases seems problematic in this case, since retrying the 2nd time returns "session already exists", and most iscsistart clients aren't prepared for the command to return a non-zero return value.
* Merge pull request #247 from matwey/iscsi_serviceLee Duncan2021-02-021-0/+1
|\ | | | | Wants=network-online.target in iscsi.service
| * Wants=network-online.target in iscsi.serviceMatwey V. Kornilov2021-02-011-0/+1
|/ | | | | | | | | | | | | | | | | Setting After= without Requires= or Wants= is not enough to pull network-online.target as a dependency. Currently, if some other service requires network-online.target then iscsi.service is started after network-online.target If no any other services require network-online.target then iscsi.service may be started before networking is working. The latter leads to the following issues: iscsiadm: Could not login to [iface: default, target: XXX, portal: XXX,3260]. iscsiadm: initiator reported error (4 - encountered connection failure) Reference: https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
* Fix iscsiadm segfault when exitingLee Duncan2021-01-261-4/+4
| | | | | | | | | | Commit b532ad67d495d added some cleanup code to iscsiadm right before it exits, but it used a list_for_each_entry() to iterate through a list was being deleted, when it should use list_for_each_entry_safe(). Fixes: b532ad67d495d
* Merge pull request #246 from B4dM4n/no-systemd-buildLee Duncan2021-01-251-0/+2
|\ | | | | iscsid: Add NO_SYSTEMD to CFLAGS
| * iscsid: Add NO_SYSTEMD to CFLAGSFabian Möller2021-01-251-0/+2
|/ | | | | | | When building with NO_SYSTEMD=1 set the -DNO_SYSTEMD CFLAG, otherwise the iscsid build tries to include the systemd header and aborts: iscsid.c:38:10: fatal error: systemd/sd-daemon.h: No such file or directory
* Merge pull request #244 from patsoffice/patsoffice/dir-perm-fix-RH-versionLee Duncan2021-01-186-15/+15
|\ | | | | Change mkdir permissions to 0770, adjust umask
| * Change mkdir permissions to 0770, adjust usmaskPatrick Lawrence2021-01-126-15/+15
| | | | | | | | | | | | | | - Change mkdir() permissions from 0660 to 0770 so that there are not SELinux dac_override violations. - Adjust the umask to preserve execute bit permission on directories created in iscsid and iscsiadm.
* | Merge pull request #243 from abvr/patch-1Lee Duncan2021-01-121-2/+2
|\ \ | | | | | | Fix typo in util.py
| * | Fix typo in util.pyAbhinav Rajagopalan2021-01-111-2/+2
|/ / | | | | Fix s/sttderr/stderr typo in line 179 of util.py
* | Merge pull request #239 from wenchao-hao/masterLee Duncan2021-01-055-19/+55
|\ \ | | | | | | Fix 4 memory leak in source code
| * | iscsiadm: Fix memory leak in iscsiadmWenchao Hao2020-12-302-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Memory allocated by iscsi_context_new() would not be freed if error occurred during parameters parser stage and goto free_ifaces is used to jump to resource clean. Since all resource clean is performed after verified, so change all goto free_ifaces to goto out where handles resource better. Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
| * | libopeniscsiusr: Fix memory leak in iscsi_sessions_get()Wenchao Hao2020-12-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If _iscsi_sids_get() gets 0 session, *session_count is 0, while calloc(*session_count, ...) might return a valid pointer although *session_count is 0. The memory allocated by calloc() would be freed in iscsi_session_free() where did not perform free operation if session_count is zero. So memory leak would occur if _iscsi_sids_get() gets 0 session, this patch just goto out on if _iscsi_sids_get() gets 0 session to avoid calloc() being called. Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
| * | libopeniscsiusr: Fix memory leak in iscsi_nodes_get()Wenchao Hao2020-12-291-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If _scandir() gets 0 node, *node_count is 0, while calloc(*node_count, ...) might return a valid pointer although *node_count is 0. The memory allocated by calloc() would be freed in iscsi_nodes_free() where did not perform free operation if node_count is zero. So memory leak might occur if _scandir() get 0 node. Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
| * | idbm: Fix memory leak and NULL pointer dereference in idbm_rec_update_param()Wenchao Hao2020-12-291-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Three memory issues in this function: 1. did not verify return value of calloc(), strdup() or malloc(); 2. memory leak of pointer tmp_value caused strsep() tmp_value would change after strsep() and free(tmp_value) would cause memory leak; 3. memory leak of pointer "found", the memory was allocated but did not freed Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
* | | Merge pull request #238 from jnschaeffer/add-iscsi-init-serviceLee Duncan2021-01-041-0/+1
|\ \ \ | | | | | | | | Add etc/systemd/iscsi-init.service to SYSTEMDFILES Makefile variable
| * | | Add etc/systemd/iscsi-init.service to SYSTEMDFILES Makefile variableJohn Schaeffer2020-12-271-0/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | iscsi-init.service is not included in the SYSTEMDFILES Makefile variable, causing it to be skipped when the install_systemd rule is executed. This causes the iscsi systemd service to fail on a fresh install, as it requires the iscsi-init service. This commit adds etc/systemd/iscsi-init.service to the list of files in SYSTEMDFILES to correct this issue.
* | | iscsid: Do not allow conflicting pid-file optionsLee Duncan2021-01-042-11/+31
|/ / | | | | | | | | | | The daemon allowed both the no-pid-file option and specifying a PID file to use, and honored which ever option was supplied last. This commmit ensures non-conflicting options are supplied.
* | Merge pull request from GHSA-r278-fm99-8rgp2.1.3Chris Leech2020-12-184-13/+80
|\ \ | | | | | | iscsiuio uIP input packet processing bounds checking fixes
| * | Preparing for version 2.1.3Chris Leech2020-12-183-2/+48
| | |
| * | check for TCP urgent pointer past end of frameChris Leech2020-12-181-5/+10
| | | | | | | | | | | | CVE-2020-17437
| * | check for u8 overflow when processing TCP optionsChris Leech2020-12-181-5/+15
| | | | | | | | | | | | CVE-2020-13988
| * | check for header length underflow during checksum calculationChris Leech2020-12-181-1/+7
|/ / | | | | | | CVE-2020-13987
* | Merge pull request #234 from wenchao-hao/masterLee Duncan2020-12-1314-21/+107
|\ \ | | | | | | fix several issues reported by a Coverity scan
| * | fwparam_ppc: Fix memory leak in fwparam_ppc.cWenchao Hao2020-12-121-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | calloc() is called because loop_devs() to allocate memory which stored in array ofwdev. These memory should be freed at the end. Signed-off-by: Wenchao Hao <haowenchao@huawei.com> Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: Wu Bo <wubo40@huawei.com>
| * | iscsiuio: Remove unused macro IFNAMSIZ defined in iscsid_ipc.cWenchao Hao2020-12-121-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IFNAMSIZ is not used in this file. IFNAMSIZ is a macro defined in net/if.h. Maybe this this macro is defined here to give it a self defined value rather than system pre-defined at beginning, while it seems the code reference the macro in this file is removed, so here we can remove it. Signed-off-by: Wenchao Hao <haowenchao@huawei.com> Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: Wu Bo <wubo40@huawei.com>
| * | fwparam_ppc: Fix illegal memory access in fwparam_ppc.cWenchao Hao2020-12-121-10/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bootpath_val is allocated in find_file() and referenced if find_file() excute successfully, while it was freed in find_file() and dereferenced after find_file() if find_file() returns 1. This patch remove free(bootpath_val) in find_file() and free bootpath_val when it is used done. Signed-off-by: Wenchao Hao <haowenchao@huawei.com> Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: Wu Bo <wubo40@huawei.com>