Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve null-dereference and enable Linux containers #9622

Merged
merged 2 commits into from Jun 16, 2015

Conversation

davidlt
Copy link
Contributor

@davidlt davidlt commented Jun 15, 2015

Notice: commit messages contains more information.

CMSSW fails on at least one site where Linux containers are used (probably instead of virtual machines). You cannot trust /etc/mtab content, go directly for /proc/self/mounts.

Same issue happens if CMSSW is compiled with ASan, in this case realpath was not doing a correct job for ".". Could be a bug in ASan interceptor.

Same PR approved for CMSSW_7_5_X: #9541

David Abdurachmanov added 2 commits June 15, 2015 14:30
After initial for-loop best might be 0x0. The patch avoids
NULL-dereference issue, which causes segfaults.

Signed-off-by: David Abdurachmanov <David.Abdurachmanov@cern.ch>
Reported-by: Sébastien Brochet <sebastien.brochet@cern.ch>
According to glibc documentation one should use `_PATH_MOUNTED`, which
by default should point to `/etc/mtab`. This file is maintained by
`mount` and `umount` programs.

This is wrong if we are running in a sandboxed everinment, e.g. Linux
containers (OpenVZ, Docker, Rocket, LXC/LXD) or chroot/proot. Then this
files comes from alternative rootfs and does not reflect actual mount
points.

On modern systems (incl. CentOS 7 and Fedora) `/etc/mtab` points to
`/proc/self/mounts`.

The patch by default reads `/proc/self/mounts` on Linux systems.

By default Docker will create a `/etc/mtab` as symlink to `/proc/mounts`
(which points to `/proc/self/mounts`) on any container.

OpenVZ documentation also request chaging `/etc/mtab` to a symlink.

Same in Linux From Scratch guide. Also reminds that `/` could be mounted
as read-only, thus `/etc/mtab` could be stale.

Signed-off-by: David Abdurachmanov <David.Abdurachmanov@cern.ch>
Reported-by: Sébastien Brochet <sebastien.brochet@cern.ch>
@cmsbuild
Copy link
Contributor

A new Pull Request was created by @davidlt for CMSSW_7_4_X.

Resolve null-dereference and enable Linux containers

It involves the following packages:

Utilities/StorageFactory

@cmsbuild, @Dr15Jones can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @wddgit this is something you requested to watch as well.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
If you are a L2 or a release manager you can ask for tests by saying 'please test' in the first line of a comment.
@Degano you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@Dr15Jones
Copy link
Contributor

please test

@Dr15Jones
Copy link
Contributor

+1

@cmsbuild
Copy link
Contributor

The tests are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_4_X IBs once checked with relvals in the development release cycle of CMSSW or unless it breaks tests. This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @Degano, @smuzaffar

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_4_X IBs once checked with relvals in the development release cycle of CMSSW (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @Degano, @smuzaffar

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_4_X IBs once checked with relvals in the development release cycle of CMSSW (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @Degano, @smuzaffar

@davidlange6
Copy link
Contributor

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants