Bug 1804849

Summary: fuse-overlayfs segfault
Product: Red Hat Enterprise Linux 8 Reporter: Adrian Reber <areber>
Component: fuse-overlayfsAssignee: Jindrich Novy <jnovy>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.1CC: ajia, ddarrah, dwalsh, gscrivan, jnovy, lsm5, mheon, tsweeney
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: fuse-overlayfs-0.7.2-5.el8, container-tools-rhel8-8020020200319160326.0d58ad57 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 15:53:22 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: 1805013, 1805014, 1805015, 1805016, 1805017    
Bug Blocks:    

Description Adrian Reber 2020-02-19 18:21:20 UTC
Trying to run easybuild in a rootless containers gives me a fuse-overlayfs segfault.

fuse-overlayfs-0.7.2-2.module+el8.2.0+5768+3759792f.x86_64
podman-1.6.4-2.module+el8.2.0+5364+301aa566.x86_64

Process 24374 (fuse-overlayfs) of user 1000 dumped core.
                                                
Stack trace of thread 24374:
#0  0x000000000040d5c0 hash_get_first (fuse-overlayfs)
#1  0x0000000000405074 count_dir_entries.isra.15 (fuse-overlayfs)
#2  0x000000000040c1cc do_rm (fuse-overlayfs)
#3  0x00007f9de6ef6afa fuse_session_process_buf_int (libfuse3.so.3)
#4  0x00007f9de6ef1f5b fuse_session_loop (libfuse3.so.3)
#5  0x0000000000403835 main (fuse-overlayfs)
#6  0x00007f9de671c6a3 __libc_start_main (libc.so.6)
#7  0x00000000004038ee _start (fuse-overlayfs)

Steps to reproduce (rootless):

$ cat Dockerfile.ohpc-gnu9-easybuild
FROM quay.io/ohpc/ohpc-gnu9:1.9.9

MAINTAINER The OpenHPC Project

RUN useradd -ms /bin/bash openhpc

RUN yum -y install EasyBuild-ohpc && \
    yum -y install patch make perl && \
    yum clean all

WORKDIR /home/openhpc
USER openhpc

ENV PATH="/opt/ohpc/pub/libs/easybuild/4.1.1/software/EasyBuild/4.1.1/bin:${PATH}"
ENV PYTHONPATH="/opt/ohpc/pub/libs/easybuild/4.1.1/software/EasyBuild/4.1.1/lib/python3.6/site-packages"

# This way all commands passed into the container are executed in a
# login shell which is necessary to get lmod working. Commands
# need to be enclosed in quotes.
ENTRYPOINT ["/bin/bash", "-l", "-c"]

$ podman build . -f Dockerfile.ohpc-gnu9-easybuild --tag=ohpc-gnu9-easybuild:1.9.9 
$ podman run ohpc-gnu9-easybuild:1.9.9 'eb --robot lz4-1.9.2-GCCcore-8.3.0.eb'

Now it will abort and the segfault from above can be seen in the logs. 

The segfault does not happen when running as root.

Comment 1 Giuseppe Scrivano 2020-02-19 21:44:41 UTC
it is fixed upstream with:

commit 214d606084453f0d2831317a9048a3cbc554fcc4
Author: Giuseppe Scrivano <gscrivan>
Date:   Wed Jan 15 00:02:43 2020 +0100

    main: check if file is whiteout
    
    when doing a lookup, make sure the returned file is not a whiteout for
    functions that expect the file to exist.
    
    Close: https://github.com/containers/fuse-overlayfs/issues/169
    
    Signed-off-by: Giuseppe Scrivano <gscrivan>


I had to add bzip2 to the Dockerfile for the command to complete

Comment 16 Alex Jia 2020-03-21 06:00:22 UTC
Verified in fuse-overlayfs-0.7.2-5.module+el8.2.0+6060+9dbc027d.x86_64.

Please also see known bug - fuse-overlayfs: could not find file with easybuild - https://bugzilla.redhat.com/show_bug.cgi?id=1815139

Comment 18 errata-xmlrpc 2020-04-28 15:53:22 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.

https://access.redhat.com/errata/RHSA-2020:1650