* selinux and thread local storage
@ 2015-04-14 18:45 mm19827
2015-04-14 19:57 ` Stephen Smalley
2015-04-16 19:56 ` mm19827
0 siblings, 2 replies; 5+ messages in thread
From: mm19827 @ 2015-04-14 18:45 UTC (permalink / raw)
To: SELinux
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 2545 bytes --]
Hi all,
I am trying to figure out something about Red Hat Bugzilla â Bug 1195074,
where nvidia libGL.so.304.125 hangs in an endless loop when loaded by
gnome-shell 3.14.
Sequence is: gnome-shell loads libGL.so which for some reason calls
is_selinux_enabled in libselinux.so at library load time, which runs into a
spinlock within init_thread_destructor when accessing the thread-local
variable destructor_initialized.
gdb print of destructor_initialized reports:
The inferior has not yet allocated storage for thread-local variables in the
shared library `/lib64/libselinux.so.1'
gdb backtrace is:
#0 0x0000003f12412495 in tls_get_addr_tail (ti=0x3509221f58,
dtv=0x7ffff7f83390, the_map=0x7ffff7f9c000)
at dl-tls.c:751
#1 0x00003ðÀÌÔÀäÀÁ
ØÌ¥¸ÑÁɽ
ÑÑɽ¹}É
Ü ¤
ÐÁɽ
ÑÑȹèÜÌ(ÈÁàÀÀÀÀÀÀÌÔÀäÀÁ
ØÌ¥¸ÑÁɽ
ÑÑɽ¹}É
Ü(¡½¹ÑáÐõ½¹ÑáÑ\x01¹ÑÉäôÁàÝåÀ°Á¥õÁ¥\x01¹ÑÉäôÀ°)
ÑÑÈõ
ÑÑÉ\x01¹ÑÉäôÁàÌÔÀäÀÄåÝÕÉɹФ
ÐÁɽ
ÑÑȹèÄÈÄ(ÌÁàÀÀÀÀÀÀÌÔÀäÀÁÈÑ¥¸Ñ½¹}É
Ý}¥¹Ñɹ
°¡õ\x01¹ÑÉäôÁàÝåÀ¤
Ð)Áɽ
ÑÑȹèÌÌÐ(ÐÁàÀÀÀÀÀÀÌÔÀäÀÁÙ¥¸¥Í}ͱ¥¹Õá}¹
±}¥¹Ñɹ
° ¤
й
±¹èÈØ(ÔÁàÀÀÀÀÀÀÌÔÁÁÕÀØ¥¸ ¤
н±¥ØÐ½±¥\x1d0¹Í¼¸Ä(ØÁàÀÀÀÀÀÀÌÔÁÀàÑÝ¥¸ ¤
н±¥ØÐ½±¥\x1d0¹Í¼¸Ä(ÜÁàÀÀÀÀÀÀÍÄÈÐÁ¥¸
±±}¥¹¥Ð¡°ôÁàÝÝääåà°
Éõ
É\x01¹ÑÉäôȰ)
ÉØõ
ÉÙ\x01¹ÑÉäôÁàÝÄà°¹Øõ¹Ù\x01¹ÑÉäôÁàÝÌÀ¤
аµ¥¹¥Ð¹èØÈ(àÁàÀÀÀÀÀÀÍÄÈÐÄÀÀÍ¥¸}±}¥¹¥Ð¡¹Øôñ½ÁÑ¥µ¥é½ÕÐø°
ÉØôñ½ÁÑ¥µ¥é)½ÕÐø°
Éôñ½ÁÑ¥µ¥é½ÕÐø°°ôñ½ÁÑ¥µ¯×¦VB\x06÷WCâ\x06\x17B\x06FÂÖæBæ3£3@¢3\x02\x03\a\x03\x03\x03\x03\x03\x036c\x13#C\x13\x03\x036"\x06â\x05öFÅöæB\x02Ö\x16åöÖ\x17\x03Ó\a6c\x13#c#3\x13CÂ\x06\x17&v3Ó"À¦\x17&wcÓ\avfffffffF3\x13Â\x06VçcÓ\avfffffffF33\x02\x06\x17B\x06FÂÖæBæ3£\x13#@¢3\x13\x02\x03\a\x03\x03\x03\x03\x03\x036c\x13#C\x03\x06C&\x12\x06â\x05öFÅ÷7F\x17'E÷W6W"\x02\x06\x17B\x02öÆ#cBöÆBÖÆçW×bÓcBç6òã ¢3\x13\x12\x03\a\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03"\x06â\x02\x02¢3\x13"\x03\a\x03\x03\x03\x03vfffffffFfFB\x06â\x02\x02¢3\x132\x03\a\x03\x03\x03\x03vfffffffFfc"\x06â\x02\x02¢3\x13B\x03\a\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x02\x06â\x02\x02 ¥F2\x06ö67W'2\x06\x17B\x06Æ'&\x17'\x06Æö\x16B\aFÖRÂ\a6ò\x06&Vf÷&R\x06vWGFær\aFò\x06Ö\x16âà¤\x16FFFöæ\x16Â\x06æ÷FR\x062\aF\x17B\x04\x06\x17fR\aF2\a\a&ö&ÆVÒ\avF\x06væöÖR×6VÆÂÂ\x06'WB\x06Ö\x16ç\x06÷FW ¦WV7WF\x16&ÆW2\x02æ6ÇVFær\x06væöÖR×6W76öâÂ\x06vÇæfòÂ\x06vÇvV\x17'2\x06Æö\x16@¦Æ$tÂç6òã3\x03Bã\x13#R\x06\x16æB\a'Vâ\x06§W7B\x06fæRà ¥F2\a\a&ö&ÆVÒ\x062\a6ÖÆ\x17"\aFò\aFR\x06öæR\x06FW67&&VB\x06à¦GG\x03¢òöÖ\x17&2ææfòó÷CÓ\x13C##S#cs\x13\x03\x03\x03\x032g#Ó\x12gsÓ ¦\x16ÇF÷Vv\x06â\x06×\x066\x176R\av\x17B\aVæÆö6·2\aFR\a7\x06æÆö6²\x062\aFò\x06Fò\x04ÄEõ\x05$TÄô\x14B\x06f÷"\x06Æ$tÂç6òà¤\x06FöâwB\aFæ²\x04ÄEõ\x05$TÄô\x14B\x062\a&V\x16ÆÇ\x06\x1fÈ\x19ÛÛÙ\b\x1cÛÛ\x1d]\x1a[Û\x10[H\x1cÝYÙÙ\Ý\x1a[ÛÏÂÚ\x18]\b^[XZÙ\È\x1a]\b\x19\x1aYXÝ[\x1d\b\x1a\x19\H\x1a\È\x1d\x1a\x18]\b^[Y\x1aXH^[\x1aXÓ\vÛËÌ
\vLH\x1a\È\x18Û^[ÜÙY\x02ÛÝ\ÙK\b\x18[\b\x1d\x1a\x18]\b\x18[\x1cÛÈ^[^[ØY\x1cÈ\x1cÛÛYH^[\x1aXY\x1aXK]^[\x1cÈ\x1dÚ\x1aXÚ\b\x1cÛÝ[\x1cÈ\x1cÝ\Ü\x19XÝ\v\b\x18]\x02ÛÝ[\x19\b\x1d\x1a\x1a\È\x1cÝYÙÙ\Ý\b\x1cÛÛYH\x1d^[\x1cÈ\x1a[]\x1aX[\x1a^]\x1a[Û\x1c\x1cØ\x19[H\x1dÚ\x1a[\x19H\x19\x1e[[ZXÈ^[^[ØY\x1a[È^[Ù\x1aXÙ[\x1a[^\x0f
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: selinux and thread local storage
2015-04-14 18:45 selinux and thread local storage mm19827
@ 2015-04-14 19:57 ` Stephen Smalley
2015-04-15 17:25 ` Daniel J Walsh
2015-04-16 19:56 ` mm19827
1 sibling, 1 reply; 5+ messages in thread
From: Stephen Smalley @ 2015-04-14 19:57 UTC (permalink / raw)
To: mm19827, SELinux, Daniel J Walsh
On 04/14/2015 02:45 PM, mm19827 wrote:
> Hi all,
>
> I am trying to figure out something about Red Hat Bugzilla – Bug 1195074,
> where nvidia libGL.so.304.125 hangs in an endless loop when loaded by
> gnome-shell 3.14.
>
> Sequence is: gnome-shell loads libGL.so which for some reason calls
> is_selinux_enabled in libselinux.so at library load time, which runs into a
> spinlock within init_thread_destructor when accessing the thread-local
> variable destructor_initialized.
>
> gdb print of destructor_initialized reports:
> The inferior has not yet allocated storage for thread-local variables in the
> shared library `/lib64/libselinux.so.1'
>
> gdb backtrace is:
>
> #0 0x0000003f12412495 in tls_get_addr_tail (ti=0x3509221f58,
> dtv=0x7ffff7f83390, the_map=0x7ffff7f9c000)
> at dl-tls.c:751
Perhaps we could address this simply by changing is_selinux_enabled() to
use a private or inlined version of getcon_raw() that does not try to
cache the result and therefore does not rely on tls?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: selinux and thread local storage
2015-04-14 19:57 ` Stephen Smalley
@ 2015-04-15 17:25 ` Daniel J Walsh
2015-04-17 12:52 ` Stephen Smalley
0 siblings, 1 reply; 5+ messages in thread
From: Daniel J Walsh @ 2015-04-15 17:25 UTC (permalink / raw)
To: Stephen Smalley, mm19827, SELinux
On 04/14/2015 03:57 PM, Stephen Smalley wrote:
> On 04/14/2015 02:45 PM, mm19827 wrote:
>> Hi all,
>>
>> I am trying to figure out something about Red Hat Bugzilla – Bug 1195074,
>> where nvidia libGL.so.304.125 hangs in an endless loop when loaded by
>> gnome-shell 3.14.
>>
>> Sequence is: gnome-shell loads libGL.so which for some reason calls
>> is_selinux_enabled in libselinux.so at library load time, which runs into a
>> spinlock within init_thread_destructor when accessing the thread-local
>> variable destructor_initialized.
>>
>> gdb print of destructor_initialized reports:
>> The inferior has not yet allocated storage for thread-local variables in the
>> shared library `/lib64/libselinux.so.1'
>>
>> gdb backtrace is:
>>
>> #0 0x0000003f12412495 in tls_get_addr_tail (ti=0x3509221f58,
>> dtv=0x7ffff7f83390, the_map=0x7ffff7f9c000)
>> at dl-tls.c:751
> Perhaps we could address this simply by changing is_selinux_enabled() to
> use a private or inlined version of getcon_raw() that does not try to
> cache the result and therefore does not rely on tls?
>
> _______________________________________________
> Selinux mailing list
> Selinux@tycho.nsa.gov
> To unsubscribe, send email to Selinux-leave@tycho.nsa.gov.
> To get help, send an email containing "help" to Selinux-request@tycho.nsa.gov.
>
>
I would be fine with that.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: selinux and thread local storage
2015-04-14 18:45 selinux and thread local storage mm19827
2015-04-14 19:57 ` Stephen Smalley
@ 2015-04-16 19:56 ` mm19827
1 sibling, 0 replies; 5+ messages in thread
From: mm19827 @ 2015-04-16 19:56 UTC (permalink / raw)
To: selinux
Reposting with correct backtrace (hopefully)
On 04/14/2015 08:45 PM, mm19827 wrote:
> Hi all,
>
> I am trying to figure out something about Red Hat Bugzilla – Bug 1195074,
> where nvidia libGL.so.304.125 hangs in an endless loop when loaded by
> gnome-shell 3.14.
>
> Sequence is: gnome-shell loads libGL.so which for some reason calls
> is_selinux_enabled in libselinux.so at library load time, which runs into a
> spinlock within init_thread_destructor when accessing the thread-local
> variable destructor_initialized.
>
> gdb print of destructor_initialized reports:
> The inferior has not yet allocated storage for thread-local variables in the
> shared library `/lib64/libselinux.so.1'
>
> gdb backtrace is:
>
#0 0x0000003f12412495 in tls_get_addr_tail (ti=0x3509221f58,
dtv=0x7ffff7f83390, the_map=0x7ffff7f9c000) at dl-tls.c:751
#1 0x000000350900af63 in getprocattrcon_raw () at procattr.c:73
#2 0x000000350900af63 in getprocattrcon_raw
(context=context@entry=0x7fffffffd9f0, pid=pid@entry=0,
attr=attr@entry=0x3509019e7b "current") at procattr.c:121
#3 0x000000350900b24e in getcon_raw_internal (c=c@entry=0x7fffffffd9f0)
at procattr.c:334
#4 0x000000350900a6ce in is_selinux_enabled_internal () at enabled.c:26
#5 0x000000350d0a5c06 in () at /lib64/libGL.so.1
#6 0x000000350d084c7b in () at /lib64/libGL.so.1
#7 0x0000003f1240feed in call_init (l=0x7ffff7f999a8,
argc=argc@entry=2, argv=argv@entry=0x7fffffffdc18,
env=env@entry=0x7fffffffdc30) at dl-init.c:62
#8 0x0000003f1241003b in _dl_init (env=<optimized out>, argv=<optimized
out>, argc=<optimized out>, l=<optimized out>) at dl-init.c:34
#9 0x0000003f1241003b in _dl_init (main_map=0x3f12623148, argc=2,
argv=0x7fffffffdc18, env=0x7fffffffdc30) at dl-init.c:124
#10 0x0000003f12400d2a in _dl_start_user () at /lib64/ld-linux-x86-64.so.2
#11 0x0000000000000002 in ()
#12 0x00007fffffffdfdd in ()
#13 0x00007fffffffdff2 in ()
#14 0x0000000000000000 in ()
This occurs at library load time, so before getting to main().
Additional note is that I have this problem with gnome-shell, but many
other executables (including gnome-session, glxinfo, glxgears) load
libGL.so.304.125 and run just fine.
This problem is similar to the one described in
http://marc.info/?t=142252697100003&r=1&w=2
although in my case what unlocks the spinlock is to do LD_PRELOAD for
libGL.so.
What makes it difficult here is that nvidia libGL.so.304.125 is closed
source, and that also loads some libnvidia-tls.so which sounds like
being involved with tls (no response from nvidia yet), so not much
really clear, but I posted this in case it may suggest anything between
selinux and tls.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: selinux and thread local storage
2015-04-15 17:25 ` Daniel J Walsh
@ 2015-04-17 12:52 ` Stephen Smalley
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Smalley @ 2015-04-17 12:52 UTC (permalink / raw)
To: Daniel J Walsh, mm19827, SELinux
On 04/15/2015 01:25 PM, Daniel J Walsh wrote:
>
> On 04/14/2015 03:57 PM, Stephen Smalley wrote:
>> On 04/14/2015 02:45 PM, mm19827 wrote:
>>> Hi all,
>>>
>>> I am trying to figure out something about Red Hat Bugzilla – Bug 1195074,
>>> where nvidia libGL.so.304.125 hangs in an endless loop when loaded by
>>> gnome-shell 3.14.
>>>
>>> Sequence is: gnome-shell loads libGL.so which for some reason calls
>>> is_selinux_enabled in libselinux.so at library load time, which runs into a
>>> spinlock within init_thread_destructor when accessing the thread-local
>>> variable destructor_initialized.
>>>
>>> gdb print of destructor_initialized reports:
>>> The inferior has not yet allocated storage for thread-local variables in the
>>> shared library `/lib64/libselinux.so.1'
>>>
>>> gdb backtrace is:
>>>
>>> #0 0x0000003f12412495 in tls_get_addr_tail (ti=0x3509221f58,
>>> dtv=0x7ffff7f83390, the_map=0x7ffff7f9c000)
>>> at dl-tls.c:751
>> Perhaps we could address this simply by changing is_selinux_enabled() to
>> use a private or inlined version of getcon_raw() that does not try to
>> cache the result and therefore does not rely on tls?
>>
>>
> I would be fine with that.
Actually, could we just drop the test altogether of whether getcon()
returns "kernel", i.e. no-policy-loaded? IIRC, this is a leftover of
Fedora Core 2 days, before we had support for SELinux runtime disable,
so that we could emulate SELinux disabled by just not loading a policy.
But these days SELinux can be disabled either via SELINUX=disabled in
/etc/selinux/config or selinux=0 and either way selinuxfs is
unregistered and /sys/fs/selinux is unmounted, so we should not need
this test anymore AFAICS.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-04-17 12:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-14 18:45 selinux and thread local storage mm19827
2015-04-14 19:57 ` Stephen Smalley
2015-04-15 17:25 ` Daniel J Walsh
2015-04-17 12:52 ` Stephen Smalley
2015-04-16 19:56 ` mm19827
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.