Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1881244

Summary: iscsiadm crash when discovering many target portals at once
Product: Red Hat Enterprise Linux 8 Reporter: Chris Leech <cleech>
Component: iscsi-initiator-utilsAssignee: Chris Leech <cleech>
Status: CLOSED ERRATA QA Contact: Filip Suba <fsuba>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.3CC: fsuba
Target Milestone: rcKeywords: EasyFix, Regression
Target Release: 8.4Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: iscsi-initiator-utils-6.2.1.2-0.gita8fcb37.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1881245 (view as bug list) Environment:
Last Closed: 2021-05-18 14:55:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1881245    

Description Chris Leech 2020-09-21 23:30:22 UTC
Description of problem:

When discovering many target portals in a single SendTargets discovery command, iscsiadm will crash due to a strcat buffer overflow.

Version-Release number of selected component (if applicable):

iscsi-initiator-utils > 6.2.0.878-0

How reproducible:

100%

Steps to Reproduce:

1. Configure an iSCSI target to report > 85 targets
   (you can just create a bunch of target names with targetcli, they don't need LUs and ACLs set)

2. iscsiadm -m discovery -t set -p <discovery portal>

Actual results:

iscsiadm will crash 

Expected results:

all targets discovered and node records created

Additional info:

This is a regression introduced with the new CHAP modes, a buffer in a struct that gets reused for each target discovered isn't reset and is appended to with the chap_algs config string with each pass until it overflows.

Reported upstream (https://github.com/open-iscsi/open-iscsi/issues/219) by a Fedora user.  Fix verified by that user, applied upstream, and to Fedora.

One line fix:
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -169,6 +169,7 @@ static struct idbm *db;
 #define __recinfo_int_list(_key,_info,_rec,_name,_show,_tbl,_n,_mod) do { \
        _info[_n].type = TYPE_INT_LIST; \
        strlcpy(_info[_n].name, _key, NAME_MAXVAL); \
+       _info[_n].value[0] = '\0'; \
        for (unsigned long _i = 0; _i < ARRAY_LEN(_rec->_name); _i++) { \
                if (_rec->_name[_i] != (unsigned)~0) {                  \
                        for (unsigned long _j = 0; _j < ARRAY_LEN(_tbl); _j++) {        \

Comment 4 Filip Suba 2020-11-27 13:45:11 UTC
Verified with iscsi-initiator-utils-6.2.1.2-0.gita8fcb37.el8.

Comment 6 errata-xmlrpc 2021-05-18 14:55:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (iscsi-initiator-utils bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2021:1618