Bug 1636295 - [OSP12] instack uses /tmp as temporary directory for DIB to run scripts, but /tmp is often mounted with noexec
Summary: [OSP12] instack uses /tmp as temporary directory for DIB to run scripts, but ...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: instack
Version: 12.0 (Pike)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 12.0 (Pike)
Assignee: Emilien Macchi
QA Contact: Artem Hrechanychenko
URL:
Whiteboard:
Depends On: 1636290
Blocks: 1652496 1661636
TreeView+ depends on / blocked
 
Reported: 2018-10-05 03:06 UTC by David Vallee Delisle
Modified: 2021-12-10 17:59 UTC (History)
8 users (show)

Fixed In Version: instack-7.0.2-2.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1636290
Environment:
Last Closed: 2018-12-13 19:45:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
instack logs (422.65 KB, application/x-gzip)
2018-11-19 15:20 UTC, Artem Hrechanychenko
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1796220 0 None None None 2018-10-05 03:06:35 UTC
OpenStack gerrit 608804 0 None stable/pike: MERGED instack: /tmp with noexec fix (Icc568d0750826b2da24e7fa3bfa6def0fb151209) 2018-11-08 20:41:13 UTC
Red Hat Bugzilla 1636290 0 high CLOSED [OSP13] instack uses /tmp as temporary directory for DIB to run scripts, but /tmp is often mounted with noexec 2022-08-04 09:23:41 UTC
Red Hat Issue Tracker OSP-11691 0 None None None 2021-12-10 17:59:04 UTC

Description David Vallee Delisle 2018-10-05 03:06:36 UTC
+++ This bug was initially created as a clone of Bug #1636290 +++

Description of problem:
A lot of deployments are mounting /tmp with noexec flag for security reasons. Because of this, it's impossible to run any executables in there, which breaks the undercloud install and undercloud upgrade processes as described here [1]

[1] https://access.redhat.com/solutions/3002821

Version-Release number of selected component (if applicable):
All

How reproducible:
All the time

Steps to Reproduce:
[stack@undercloud-0 ~]$ echo "tmpfs /tmp tmpfs mode=1777,nosuid,nodev,noexec 0 0" | sudo tee -a /etc/fstab
[stack@undercloud-0 ~]$ sudo mount /tmp
[stack@undercloud-0 ~]$ sudo systemctl stop 'openstack-*' 'neutron-*' httpd
[stack@undercloud-0 ~]$ sudo yum update python-tripleoclient
[stack@undercloud-0 ~]$ openstack undercloud (upgrade or install)

Actual results:
instack uses tempfile.mkdtemp() without any argument to create a temporary folder to store scripts that are going to be run by dib-run-parts. When dib-run-parts starts, it runs a find /tmp/path/to/scripts -executable which returns nothing and it quits.


Expected results:
instack should use a different prefix. 


Additional info:
in instack/main.py, we already use ~stack/.instack/ to store the logs. It might be a good candidate to store the temp folders, for example: ~stack/.instack/tmp/

Comment 10 Artem Hrechanychenko 2018-11-19 15:20:46 UTC
Created attachment 1507299 [details]
instack logs

instack logs for different cases

install undercloud
change fstab and re-install undercloud


change fstab and re-install undercloud from scratch


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