Bug 1481433 - retrace-server-interact fails with 'No such file or directory' due to retrace-server creating 'crash' subdirectory without group read permissions
Summary: retrace-server-interact fails with 'No such file or directory' due to retrace...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: retrace-server
Version: el6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dave Wysochanski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-14 21:20 UTC by Dave Wysochanski
Modified: 2018-02-20 16:24 UTC (History)
5 users (show)

Fixed In Version: retrace-server-1.18.0-1.fc27 retrace-server-1.18.0-1.el7
Clone Of:
Environment:
Last Closed: 2018-02-13 17:52:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
patch to fix this bug (1.65 KB, application/octet-stream)
2017-08-14 22:48 UTC, Dave Wysochanski
no flags Details

Description Dave Wysochanski 2017-08-14 21:20:26 UTC
Description of problem:
It's possible for retrace-server to retrace successfully a vmcore in a tarball and end up with a 'crash' directory underneath the task that is unreadable by anything other than the user (retrace).  This means anyone trying to run 'retrace-server-interact' will get a "No such file or directory" error, and the vmcore is unusable from the perspective of interact mode.

Any tarball that contains a 'cwd' which is unreadable this happens.  For example:
tar -cvf /tmp/rhel7u2-node1-vmcore.tgz ./
./
./vmcore-dmesg.txt
./vmcore
$ tar -tvf /tmp/rhel7u2-node1-vmcore.tgz 
drwx------ user/user 0 2017-08-14 16:57 ./
-rw-r--r-- user/user 42425 2015-11-24 10:14 ./vmcore-dmesg.txt
-rw------- user/user 44915206 2015-11-24 10:14 ./vmcore

$ retrace-server-interact 332586857 crash
If you want to execute the command manually, you can run
$ crash -i /cores/retrace/tasks/332586857/crashrc /cores/retrace/tasks/332586857/crash/vmcore /cores/retrace/repos/kernel/x86_64/usr/lib/debug/lib/modules/3.10.0-327.el7.x86_64/vmlinux


crash 7.1.9
Copyright (C) 2002-2016  Red Hat, Inc.
Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation
Copyright (C) 1999-2006  Hewlett-Packard Co
Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited
Copyright (C) 2006, 2007  VA Linux Systems Japan K.K.
Copyright (C) 2005, 2011  NEC Corporation
Copyright (C) 1999, 2002, 2007  Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux, Inc.
This program is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions.  Enter "help copying" to see the conditions.
This program has absolutely no warranty.  Enter "help warranty" for details.
 
crash: /cores/retrace/tasks/332586857/crash/vmcore: No such file or directory

Usage:

  crash [OPTION]... NAMELIST MEMORY-IMAGE[@ADDRESS]     (dumpfile form)
  crash [OPTION]... [NAMELIST]                          (live system form)

Enter "crash -h" for details.
$ ls -ld /cores/retrace/tasks/332586857/crash
drwx-w----. 2 retrace retrace-group 27 Aug 14 17:10 /cores/retrace/tasks/332586857/crash
$ ls -l /cores/retrace/tasks/332586857/crash/vmcore
ls: cannot access /cores/retrace/tasks/332586857/crash/vmcore: Permission denied



Version-Release number of selected component (if applicable):
retrace-server-1.17.0-3.el6.noarch

$ rpm -q retrace-server --changelog | head
* Thu Apr 06 2017 Dave Wysochanski <dwysocha> 1.17.0-3
- Fix problem with missing modules on kernel versions with cached vmlinux files.
- Fix typeo in manager.wsgi which creates a backtrace on non-ftp tasks.

* Thu Mar 30 2017 Matej Marusak <mmarusak> 1.17.0-1
- Enable creating releases with makefile
- Introduce gen-version
- Do not use fedorahosted.org as source
- Include md5sum of original archive in summary page
- Do not try to get default time when ftptask


How reproducible:
Trivial


Steps to Reproduce:
1. Submit a vmcore to retrace-server inside a tarball with the 'cwd' containing only user readable permissions

Actual results:
the vmcore is extracted and setup ok with a task directory, but the 'crash' subdirectory containing the vmcore is not readable by anything other than user (retrace)

Expected results:
the 'crash' subdirectory is group readable so users can use interactive mode on the vmcore

Additional info:
Note that this first came in via an 'abrt' tarball.  Can't say yet but this may have been there for a long time.  It is similar to an earlier fixed bug, https://bugzilla.redhat.com/show_bug.cgi?id=1076833, but this one deals with the crash subdirectory specifically, not the vmcore file.  My guess is abrt team did not see this yet due to the fact that they do not use interactive mode, and it is a corner case that may not happen too often.

I will attach a tarball containing a vmcore to reproduce this issue.

Comment 1 Dave Wysochanski 2017-08-14 21:22:40 UTC
Unfortunately my vmcore is too big to attach.

Comment 4 Dave Wysochanski 2017-08-14 22:48:31 UTC
Created attachment 1313384 [details]
patch to fix this bug

Comment 5 Dave Wysochanski 2017-08-14 22:50:05 UTC
Running regression tests now on patch from comment #4.  Assuming these pass and I don't find any other  issues I will submit to upstream.

Comment 6 Matej Marušák 2017-08-15 07:22:33 UTC
Thank you Dave for the BZ and the patch as well. When you test it, please create pull request upstream and I will test it as well.

Comment 7 Dave Wysochanski 2017-08-15 10:24:55 UTC
https://github.com/abrt/retrace-server/pull/159

Comment 8 Dave Wysochanski 2018-01-17 15:32:55 UTC
Pull request merged

Comment 9 Fedora Update System 2018-02-01 15:52:04 UTC
retrace-server-1.18.0-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-e5741ca105

Comment 10 Fedora Update System 2018-02-01 15:52:35 UTC
retrace-server-1.18.0-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-bc35ca9028

Comment 11 Fedora Update System 2018-02-02 18:24:38 UTC
retrace-server-1.18.0-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-bc35ca9028

Comment 12 Fedora Update System 2018-02-02 18:47:54 UTC
retrace-server-1.18.0-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-e5741ca105

Comment 13 Fedora Update System 2018-02-13 17:52:04 UTC
retrace-server-1.18.0-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2018-02-20 16:24:01 UTC
retrace-server-1.18.0-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.


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