Bug 509654 - confined nspluginwrapper causes flash to crash (with avc)
confined nspluginwrapper causes flash to crash (with avc)
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
11
All Linux
low Severity medium
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-04 11:18 EDT by drago01
Modified: 2010-06-28 09:29 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-06-28 09:29:06 EDT
Type: ---
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 drago01 2009-07-04 11:18:48 EDT
Description of problem:
I have enabled the confined nspluginwrapper boolean which seems to work fine but on some flash sites the plugin segfaults.
dmesg shows this avc:
----------------
ype=1400 audit(1246719727.017:26): avc:  denied  { read } for  pid=23711 comm="npviewer.bin" name="pulse-shm-4260538576" dev=tmpfs ino=24002 scontext=unconfined_u:unconfined_r:nsplugin_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:tmpfs_t:s0 tclass=file
type=1400 audit(1246719727.206:27): avc:  denied  { read } for  pid=23711 comm="npviewer.bin" name="pulse-shm-4260538576" dev=tmpfs ino=24002 scontext=unconfined_u:unconfined_r:nsplugin_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:tmpfs_t:s0 tclass=file
type=1400 audit(1246719730.752:28): avc:  denied  { associate } for  pid=23711 comm="npviewer.bin" key=-583345475 scontext=unconfined_u:unconfined_r:nsplugin_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_execmem_t:s0-s0:c0.c1023 tclass=shm
type=1400 audit(1246719730.752:29): avc:  denied  { associate } for  pid=23711 comm="npviewer.bin" key=-583345475 scontext=unconfined_u:unconfined_r:nsplugin_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_execmem_t:s0-s0:c0.c1023 tclass=shm
npviewer.bin[23711]: segfault at a010 ip 000000000101d6b0 sp 00000000fffe7390 error 4 in libflashplayer.so[dcc000+952000]
----------------

Version-Release number of selected component (if applicable):
selinux-policy-3.6.12-53.fc11.noarch

How reproducible:
Sometimes
seems like not all flash sites are effected

Steps to Reproduce:
1. surf some flash sites with the nsplugin confined
  
Actual results:

AVC + segfault

Expected results:

no avc and no segfault.

Additional info:

audit2allow -d


#============= ifconfig_t ==============
allow ifconfig_t security_t:file read;

#============= mysqld_safe_t ==============
allow mysqld_safe_t mysqld_db_t:dir { write remove_name };
allow mysqld_safe_t mysqld_var_run_t:sock_file unlink;

#============= nsplugin_t ==============
allow nsplugin_t tmpfs_t:file { read getattr open };
allow nsplugin_t unconfined_execmem_t:shm { read write getattr associate destroy



(Note there are other issues here too but the last one is this specific one)
Comment 1 Daniel Walsh 2009-07-06 14:24:19 EDT
First two ifconfig_dt and mysqld_safe_t are fixed in latestfc11 policy I believe.

What process is running as unconfined_execmem_t?  Firefox should not be?

Looks like a labeled problem and the tmpfs_t file got created with the wrong context.
Comment 2 drago01 2009-07-06 14:33:50 EDT
(In reply to comment #1)
> First two ifconfig_dt and mysqld_safe_t are fixed in latestfc11 policy I
> believe.

OK, which version are you refering to?

> What process is running as unconfined_execmem_t?  Firefox should not be?

It is firefox...

ps auxZ | grep execm
unconfined_u:unconfined_r:unconfined_execmem_t:s0-s0:c0.c1023 linux 7598 1.7  8.0 1355932 486024 ? Sl 11:04  10:10 /usr/lib64/firefox-3.5/firefox
unconfined_u:unconfined_r:unconfined_execmem_t:s0-s0:c0.c1023 linux 8615 0.0  0.0 0 0 ? Z 12:09   0:00 [firefox] <defunct>
unconfined_u:unconfined_r:unconfined_execmem_t:s0-s0:c0.c1023 linux 8630 0.0  0.0 0 0 ? Z 12:11   0:03 [firefox] <defunct>
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 linux 31280 0.0  0.0 91080 872 pts/4 S+ 20:30   0:00 grep execm

 
> Looks like a labeled problem and the tmpfs_t file got created with the wrong
> context.  

I have tried to reproduce it and now I only get:

type=1400 audit(1246904932.131:6): avc:  denied  { associate } for  pid=31144 comm="npviewer.bin" key=-583345475 scontext=unconfined_u:unconfined_r:nsplugin_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=sem
type=1400 audit(1246904932.131:7): avc:  denied  { associate } for  pid=31144 comm="npviewer.bin" key=-583345475 scontext=unconfined_u:unconfined_r:nsplugin_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=sem
type=1400 audit(1246905080.052:8): avc:  denied  { associate } for  pid=31144 comm="npviewer.bin" key=-583345475 scontext=unconfined_u:unconfined_r:nsplugin_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=sem
type=1400 audit(1246905080.052:9): avc:  denied  { associate } for  pid=31144 comm="npviewer.bin" key=-583345475 scontext=unconfined_u:unconfined_r:nsplugin_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=sem

But no crashes.

#============= nsplugin_t ==============
allow nsplugin_t unconfined_t:sem associate;
Comment 3 Daniel Walsh 2009-07-06 15:09:54 EDT
WHat is firefox labeled,   It should be labed mozilla_exec_t?

We should add the associate call.
Comment 4 Daniel Walsh 2009-07-06 15:11:47 EDT
Miroslav,

add

	allow nsplugin_t $2:sem rw_sem_perms;
	allow nsplugin_t $2:shm rw_shm_perms;

to nsplugin_role_notrans
Comment 5 drago01 2009-07-06 15:50:43 EDT
(In reply to comment #3)
> WHat is firefox labeled,   It should be labed mozilla_exec_t?


ls -Z /usr/bin/firefox 
-rwxr-xr-x. root root system_u:object_r:bin_t:s0       /usr/bin/firefox

ls -Z /usr/lib64/firefox-3.5/firefox
-rwxr-xr-x. root root system_u:object_r:mozilla_exec_t:s0 /usr/lib64/firefox-3.5/firefox
Comment 6 Daniel Walsh 2009-07-06 16:07:57 EDT
optional_policy(`
tunable_policy(`allow_unconfined_nsplugin_transition',`', `
	gen_require(`
		type mozilla_exec_t;
	')
	domtrans_pattern(unconfined_t, mozilla_exec_t, unconfined_execmem_t)
')
')

That is strange, 

the policy above says to only transition if the allow_unconfined_nsplugin_transition boolean is turned off?
Comment 7 Miroslav Grepl 2009-07-07 04:36:20 EDT
(In reply to comment #4)
> Miroslav,
> 
> add
> 
>  allow nsplugin_t $2:sem rw_sem_perms;
>  allow nsplugin_t $2:shm rw_shm_perms;
> 
> to nsplugin_role_notrans  

Fixed in selinux-policy-3.6.12-64.fc11
Comment 9 Bug Zapper 2010-04-27 11:29:27 EDT
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 10 Bug Zapper 2010-06-28 09:29:06 EDT
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

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