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 2062291

Summary: Segfault in 'buffered_getchar()' function in bash
Product: Red Hat Enterprise Linux 8 Reporter: Paulo Andrade <pandrade>
Component: bashAssignee: Siteshwar Vashisht <svashisht>
Status: CLOSED ERRATA QA Contact: Karel Volný <kvolny>
Severity: medium Docs Contact:
Priority: urgent    
Version: 8.4CC: fkrska, juqiao, kdudka, kvolny, lnykryn, lzaoral, sujagtap, svashisht
Target Milestone: rcKeywords: Reopened, Triaged, ZStream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: bash-4.4.20-4.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2079236 2097659 2099291 (view as bug list) Environment:
Last Closed: 2023-12-04 15:19:44 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: 2079236, 2097659, 2099291    

Description Paulo Andrade 2022-03-09 13:39:25 UTC
User pointed the link
https://www.mail-archive.com/search?l=bug-bash@gnu.org&q=subject:%22segfault%22&o=newest&f=1
and provided a bash segfault.

  Based on the backtrace state, the patch at
https://www.mail-archive.com/bug-bash@gnu.org/msg19832.html
will correct the issue (no reproducer available):

"""
(gdb) bt
#0  0x0000561e672c8338 in buffered_getchar () at input.c:565
#1  0x0000561e67289cf3 in yy_getc () at ./parse.y:2300
#2  shell_getc (remove_quoted_newline=1) at ./parse.y:2300
#3  shell_getc (remove_quoted_newline=1) at ./parse.y:2219
#4  0x0000561e6728d09a in read_token (command=<optimized out>)
    at ./parse.y:3117
#5  read_token (command=0) at ./parse.y:3067
#6  0x0000561e672909d8 in yylex () at ./parse.y:2676
#7  yyparse () at y.tab.c:1834
#8  0x0000561e6728714a in parse_command () at eval.c:262
#9  0x0000561e67287258 in read_command () at eval.c:306
#10 0x0000561e672874e0 in reader_loop () at eval.c:150
#11 0x0000561e67285bdb in main (argc=3, argv=0x7ffc42334f78, 
    env=0x7ffc42334f98) at shell.c:802

(gdb) p bash_input.location.buffered_fd
$1 = 255
(gdb) p buffers
$2 = (BUFFERED_STREAM **) 0x7fb33e880000
(gdb) p buffers[bash_input.location.buffered_fd]
$3 = (BUFFERED_STREAM *) 0x0
"""

  In the first link, I could also reproduce the crash
https://www.mail-archive.com/bug-bash@gnu.org/msg19558.html
that might require a backport of patches (did not find direct
link to patch...) The other reports appear fixed in rhel8 bash.