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 1794884 - HISTTIMEFORMAT causes Segmentation fault under certain conditions
Summary: HISTTIMEFORMAT causes Segmentation fault under certain conditions
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: bash
Version: 8.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: 8.0
Assignee: Siteshwar Vashisht
QA Contact: Karel Volný
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-25 02:25 UTC by Need Real Name
Modified: 2024-02-27 11:40 UTC (History)
1 user (show)

Fixed In Version: bash-4.4.20-2.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 20:03:01 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:4495 0 None None None 2021-11-09 20:03:11 UTC

Description Need Real Name 2020-01-25 02:25:42 UTC
Description of problem:

Enabling HISTTIMEFORMAT causes Segmentation fault (core dumped) if earlier history happens to contain certain data


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

4.3.30

How reproducible:

always

Steps to Reproduce:

1. Type the following nonsence line in bash
#1533478054739861000    # Dropped connection peer_ipc_nbsock_id 36

2. (the above will store that line in the .bash_history file when you log out)

3. Log out, log back in, enable HISTTIMEFORMAT="%F %T " (e.g. in /etc/profile)

4. run the "history" command.

Actual results:

[root@hpz ~]# history >out
Segmentation fault (core dumped)
[cnd@hpz ~]$ 

Expected results:

no core dump

Additional info:

Comment 1 Need Real Name 2020-01-25 02:28:36 UTC
note that you need to start this exercise *without* the HISTTIMEFORMAT already in use.

(If there are already valid times before the malformed data, I didn't see the same core dump)

Comment 4 RHEL Program Management 2021-07-25 07:30:13 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 5 Kamil Dudka 2021-07-26 07:17:06 UTC
I am able to reproduce it:

[root@ci-vm-10-0-138-227 ~]# rpm -q bash
bash-4.4.20-1.el8_4.x86_64

[root@ci-vm-10-0-138-227 ~]# printf '#1533478054739861000\n:\n' > .bash_history
[root@ci-vm-10-0-138-227 ~]# bash -l
[root@ci-vm-10-0-138-227 ~]# HISTTIMEFORMAT=%F history
Segmentation fault (core dumped)


It seems that el9 bash validates the timestamp properly though:

[root@ci-vm-10-0-138-137 ~]# rpm -q bash
bash-5.1.0-3.el9.x86_64

[root@ci-vm-10-0-138-137 ~]# printf '#1533478054739861000\n:\n' > .bash_history
[root@ci-vm-10-0-138-137 ~]# bash -l
[root@ci-vm-10-0-138-137 ~]# HISTTIMEFORMAT=%F history
    1  1533478054739861000: invalid timestamp:
    2  2021-07-26HISTTIMEFORMAT=%F history

Comment 17 Karel Volný 2021-08-29 21:17:21 UTC
# HISTTIMEFORMAT=%F history
    1  1533478054739861000: invalid timestamp:blah
    2  2021-08-29history
    3  2021-08-29HISTTIMEFORMAT=%F history
# rpm -q bash
bash-5.1.8-2.el9.x86_64

Comment 19 errata-xmlrpc 2021-11-09 20:03:01 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 (bash 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-2021:4495


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