Bug 1281437 - ValueError when install chromium package
ValueError when install chromium package
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: policycoreutils (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Petr Lautrbach
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-12 09:29 EST by Tomas Popela
Modified: 2015-11-12 10:02 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-12 10:02:40 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tomas Popela 2015-11-12 09:29:07 EST
Description of problem:
When installing the chromium package ( it is still under review in https://bugzilla.redhat.com/show_bug.cgi?id=1270322 ) the following lines:

semanage fcontext -a -t execmem_exec_t %{chromium_path}/%{chromium_browser_channel}
semanage fcontext -a -t bin_t %{chromium_path}/%{chromium_browser_channel}.sh
semanage fcontext -a -t chrome_sandbox_exec_t %{chromium_path}/chrome-sandbox
restorecon -R -v %{chromium_path}/%{chromium_browser_channel}

that become

semanage fcontext -a -t execmem_exec_t /usr/lib64/chromium-browser/chromium-browser
semanage fcontext -a -t bin_t /usr/lib64/chromium-browser/chromium-browser.sh
semanage fcontext -a -t chrome_sandbox_exec_t /usr/lib64/chromium-browser/chrome-sandbox
restorecon -R -v /usr/lib64/chromium-browser

are producing errors that are attached below. Even the suggested change does not work.

Version-Release number of selected component (if applicable):
policycoreutils-2.4-14.fc23.x86_64

How reproducible:
Always

Actual results:
# ValueError: File spec /usr/lib64/chromium-browser/chromium-browser conflicts with equivalency rule '/usr/lib64 /usr/lib'; Try adding '/usr/lib/chromium-browser/chromium-browser' instead
# ValueError: File spec /usr/lib64/chromium-browser/chromium-browser.sh conflicts with equivalency rule '/usr/lib64 /usr/lib'; Try adding '/usr/lib/chromium-browser/chromium-browser.sh' instead
# ValueError: File spec /usr/lib64/chromium-browser/chrome-sandbox conflicts with equivalency rule '/usr/lib64 /usr/lib'; Try adding '/usr/lib/chromium-browser/chrome-sandbox' instead


Expected results:
No errors.
Comment 1 Miroslav Grepl 2015-11-12 09:57:58 EST
I believe 

# ValueError: File spec /usr/lib64/chromium-browser/chromium-browser conflicts with equivalency rule '/usr/lib64 /usr/lib'; Try adding '/usr/lib/chromium-browser/chromium-browser' instead
# ValueError: File spec /usr/lib64/chromium-browser/chromium-browser.sh conflicts with equivalency rule '/usr/lib64 /usr/lib'; Try adding '/usr/lib/chromium-browser/chromium-browser.sh' instead
# ValueError: File spec /usr/lib64/chromium-browser/chrome-sandbox conflicts with equivalency rule '/usr/lib64 /usr/lib'; Try adding '/usr/lib/chromium-browser/chrome-sandbox' instead

is correct and the problem is

semanage fcontext -a -t execmem_exec_t /usr/lib64/chromium-browser/chromium-browser

does not work.
Comment 2 Petr Lautrbach 2015-11-12 10:00:51 EST
It's correct. You can't add a file context into tree where is already equivalence:

# semanage fcontext -l
...
SELinux Distribution fcontext Equivalence 

/lib = /usr/lib
/usr/lib64 = /usr/lib
/lib64 = /usr/lib
/usr/local/lib32 = /usr/lib
/usr/local/lib64 = /usr/lib

The suggested change would work but there's another issue. execmem_exec_t is just alias and semanage requires a type:

# semanage fcontext -a -t execmem_exec_t /usr/lib/chromium-browser/chromium-browser  
ValueError: Type execmem_exec_t is invalid, must be a file or device type

# seinfo -texecmem_exec_t
   TypeName bin_t
   Aliases
      unconfined_execmem_exec_t
      java_exec_t
      ls_exec_t
      mono_exec_t
      execmem_exec_t
      sbin_t

# semanage fcontext -a -t bin_t /usr/lib/chromium-browser/chromium-browse

#

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