Wrong path reported in /proc/self/maps with overlayfs

Bug #1964426 reported by Luis Héctor Chávez
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux-signed-gcp-5.13 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When a program is running in an overlayfs, /proc/self/maps reports the wrong path. Notably, it lacks a prefix equal to the mountpoint of the overlayfs. This only happens on linux-gcp-5.13, it does not reproduce on non-gcp kernels.

Small repro:

cat << "EOF" > repro.sh
#!/usr/bin/env bash

mkdir -p /tmp/overlay
mkdir -p /tmp/work
mkdir -p /tmp/upper
mkdir -p /tmp/lower
mount -t overlay overlay /tmp/overlay -o lowerdir=/tmp/lower,upperdir=/tmp/upper,workdir=/tmp/work
cp $(which cat) /tmp/overlay
/tmp/overlay/cat /proc/self/maps | grep '\/tmp\/overlay\/cat'
if [ $? -ne 0 ]; then
    echo 'Bug!'
else
    echo 'No bug!'
fi
umount /tmp/overlay
EOF
sudo bash repro.sh

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: linux-image-5.13.0-1019-gcp 5.13.0-1019.23~20.04.1
ProcVersionSignature: Ubuntu 5.13.0-1019.23~20.04.1-gcp 5.13.19
Uname: Linux 5.13.0-1019-gcp x86_64
ApportVersion: 2.20.11-0ubuntu27.21
Architecture: amd64
CasperMD5CheckResult: skip
Date: Thu Mar 10 01:49:37 2022
ProcEnviron:
 TERM=alacritty
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=C.UTF-8
 SHELL=/bin/bash
SourcePackage: linux-signed-gcp-5.13
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Luis Héctor Chávez (luisreplit) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux-signed-gcp-5.13 (Ubuntu):
status: New → Confirmed
Revision history for this message
Simon Déziel (sdeziel) wrote :

FYI, I've quoted the "EOF" to avoid the heredocs from turning the "$?" into "0".

description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.