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 966602 - potential data loss when TAPE is set
Summary: potential data loss when TAPE is set
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: sos
Version: 6.4
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: rc
: ---
Assignee: Bryn M. Reeves
QA Contact: Filip Holec
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-23 14:24 UTC by Bryn M. Reeves
Modified: 2018-12-03 18:55 UTC (History)
7 users (show)

Fixed In Version: sos-2.2-39.el6
Doc Type: Bug Fix
Doc Text:
Cause: The sosreport command incorrectly assumes that the tar program will always default to writing data on standard output. This is not the case when the environment variable TAPE is set. Consequence: Data may be unexpectedly written to a tape device, or another location, expanded to by the TAPE environment variable. Fix: The sosreport command now always calls tar with the '-f-' option to force data to be written to standard output. Result: The location to which sos writes data is no longer influenced by the TAPE environment variable. Users who set this variable in their environment can run sosreport without risking overwriting data on existing tape devices.
Clone Of:
Environment:
Last Closed: 2013-11-21 22:39:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1688 0 normal SHIPPED_LIVE sos bug fix and enhancement update 2013-11-21 00:39:30 UTC

Description Bryn M. Reeves 2013-05-23 14:24:01 UTC
Description of problem:
The tar invocation used by sos is effectively:

  tar -c $PATH | $COMPRESS > $OUTPUT_FILE

This is vulnerable to unexpected behaviour when the user has set the TAPE environment variable to some tape device in the system. Depending on the state of the device this could interfere with normal tape operations or corrupt data that is already present on the tape device.

Version-Release number of selected component (if applicable):
sos-2.2-*.el6

How reproducible:
100%

Steps to Reproduce:
Without a tape device present:
1. # file /dev/st0
/dev/st0: cannot open `/dev/st0' (No such file or directory)
2. # TAPE="/dev/st0" sosreport --batch -o general
3. # file /dev/st0

Actual results:
# file /dev/st0
/dev/st0: POSIX tar archive (GNU)

No sosreport is generated in TMP.

Expected results:
# file /dev/st0
/dev/st0: cannot open `/dev/st0' (No such file or directory)

An sosreport is generated in TMP.

Additional info:
sos should always use '-f-' to explicitly write the archive to stdout.

Comment 1 Bryn M. Reeves 2013-05-23 14:50:40 UTC
https://github.com/sosreport/sosreport/commit/3b868b2

Comment 6 errata-xmlrpc 2013-11-21 22:39:29 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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHBA-2013-1688.html


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