Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 667226 - linux_ro_checker produces false positives in the presence of read-only bind mounts
Summary: linux_ro_checker produces false positives in the presence of read-only bind m...
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 23851
  Show dependency tree
 
Reported: 2018-09-28 13:27 UTC by Mira Ressel
Modified: 2018-09-28 17:37 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mira Ressel 2018-09-28 13:27:13 UTC
Portage's logic to detect read-only filesystems (lib/portage/util/writeable_check.py) is broken because it incorrectly assumes that the st_dev value returned by stat() matches only one of the filesystems listed in /proc/self/mountinfo.

This assumption is incorrect because bind mounts share the st_dev value of their parent, but have an independent read-only/read-write status. (There may be other scenarios where the assumption fails, for example with btrfs snapshots.)

This isn't a huge issue because this whole check will only be triggered when Portage has already detected that a directory isn't writable -- so in general, when this bug is triggered, there's indeed a reason to abort the merge, Portage just does so with a nonsensical error message.

For example, I ran into this when I tried to emerge openssh -- /var/empty wasn't writable due to a problem on my system, but instead of exiting with the error message "Hey, I can't write /var/empty", Portage instead complained that /home/www/packages (a read-only bind mount from /var/portage/distfiles) was mounted read-only.