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 2053503 - Please change struct stk sktref field type from short to int [rhel-7.9.z]
Summary: Please change struct stk sktref field type from short to int [rhel-7.9.z]
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ksh
Version: 7.9
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Vincent Mihalkovič
QA Contact: Karel Volný
URL:
Whiteboard:
Depends On:
Blocks: 2116372
TreeView+ depends on / blocked
 
Reported: 2022-02-11 12:52 UTC by Paulo Andrade
Modified: 2022-08-09 11:52 UTC (History)
3 users (show)

Fixed In Version: ksh-20120801-144.el7_9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2116372 (view as bug list)
Environment:
Last Closed: 2022-08-09 11:51:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-112021 0 None None None 2022-02-11 13:00:06 UTC
Red Hat Product Errata RHBA-2022:5938 0 None None None 2022-08-09 11:51:32 UTC

Description Paulo Andrade 2022-02-11 12:52:07 UTC
Copy&paste of the requested patch:

"""
diff -up ksh-20120801/src/lib/libast/misc/stk.c.orig ksh-20120801/src/lib/libast/misc/stk.c
--- ksh-20120801/src/lib/libast/misc/stk.c.orig	2022-01-31 16:06:11.923069379 -0300
+++ ksh-20120801/src/lib/libast/misc/stk.c	2022-01-31 16:06:54.896802455 -0300
@@ -76,7 +76,7 @@ struct frame
 struct stk
 {
 	_stk_overflow_	stkoverflow;	/* called when malloc fails */
-	short		stkref;	/* reference count; */
+	int		stkref;	/* reference count; */
 	short		stkflags;	/* stack attributes */
 	char		*stkbase;	/* beginning of current stack frame */
 	char		*stkend;	/* end of current stack frame */
"""

  In bz#2007364 we had ksh patched to use the stack robustness
patch. It "almost" corrected the problem for a customer.

  Unfortunately, it still kept crashing on average once every
day. Customer is experimenting with a "guess" package with the
above patch, and it is already more than 2 days without a crash.
So, it should have had some side effect.
  Optionally, the code could be reviewed to check when the stkref
field is increased/decreased and catch a wrap around before it
happens.

Comment 3 Vincent Mihalkovič 2022-03-01 15:39:53 UTC
The requested patch is related to this change https://github.com/ksh93/ksh/commit/56805b25af24f454cdd477609bcddc984628bc01#diff-743671e15792442098dcd4e1d0800309eafe0f038f7d07bb9074034b83298d85R79,
from upstream commit https://github.com/ksh93/ksh/commit/56805b25af24f454cdd477609bcddc984628bc01:
"... Make the stack more resilient by extending the stack reference
  counter 'stkref' from (signed) short to unsigned int. On modern
  systems with 32-bit ints, this extends the maximum number of
  elements on a stack from 2^15-1==32767 to 2^32-1==4294967295.
  The ref counter can never be negative, so there is no reason for
  signedness. sizeof(int) is defined as the size of a single CPU
  word, so this should not affect performance at all.
     On a 16-bit system (not that ksh still compiles there), this
  doubles the max number of entries to 2^16-1=65535."

So I slightly modified requested patch (I used unsigned int instead of int):
Here is scratch-build: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=43451843
and private-branch: http://pkgs.devel.redhat.com/cgit/rpms/ksh/commit/?h=private-vmihalko-rhel-7.9-bz2053503&id=339ae13cafcae16f0ec43dc48898610c568270b6

Comment 16 errata-xmlrpc 2022-08-09 11:51:28 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 (ksh 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-2022:5938


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