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 1881245 - iscsiadm crash when discovering many target portals at once
Summary: iscsiadm crash when discovering many target portals at once
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: iscsi-initiator-utils
Version: 7.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 7.9
Assignee: Chris Leech
QA Contact: Filip Suba
URL:
Whiteboard:
Depends On: 1881244
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-21 23:34 UTC by Chris Leech
Modified: 2021-09-03 13:47 UTC (History)
4 users (show)

Fixed In Version: iscsi-initiator-utils-6.2.0.874-20.el7_9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1881244
Environment:
Last Closed: 2020-12-15 11:09:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:5433 0 None None None 2020-12-15 11:09:59 UTC

Description Chris Leech 2020-09-21 23:34:14 UTC
+++ This bug was initially created as a clone of Bug #1881244 +++

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 Chris Leech 2020-09-21 23:37:00 UTC
This also applies to 7.9 iscsi-initator-utils >= 6.2.0-874.18

Comment 10 Filip Suba 2020-10-27 07:50:46 UTC
Verified with iscsi-initiator-utils-6.2.0.874-20.el7_9. Regression testing passed.

Comment 16 errata-xmlrpc 2020-12-15 11:09:57 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/RHBA-2020:5433


Note You need to log in before you can comment on or make changes to this bug.