Seahorse issues

Coleman Kane cokane at FreeBSD.org
Fri Apr 11 14:14:24 UTC 2008


Coleman Kane wrote:
> Joe Marcus Clarke wrote:
>> On Wed, 2008-04-09 at 17:28 -0400, Coleman Kane wrote:
>>  
>>> Joe Marcus Clarke wrote:
>>>    
>>>> On Wed, 2008-04-09 at 14:23 -0400, Coleman Kane wrote:
>>>>        
>>>>> I recently updated to GNOME 2.22, and ever since I have not been 
>>>>> able to have seahorse work, breaking application integration with 
>>>>> GPG, etc....
>>>>>
>>>>> I filed a bug with the GNOME project, but perhaps someone else is 
>>>>> running into this:
>>>>> http://bugzilla.gnome.org/show_bug.cgi?id=527193
>>>>>             
>>>> They will most likely come back and tell you to get a backtrace with
>>>> symbols.  It looks like a problem with either missing headers or a
>>>> missing cast, though.  If I'm right, this would only affect 64-bit
>>>> platforms.
>>>>
>>>> Joe
>>>>         
>>> Thanks, I pre-empted that by rigging the seahorse build so that it 
>>> built with -g -O0, and copied the non-stripped seahorse-agent binary 
>>> into /usr/local/bin for my submitted backtrace. Amazingly enough, it 
>>> turns out that even if you specify --enable-debug on the configure 
>>> line, the installation step still decided to strip the binaries 
>>> after installation. nice.
>>>
>>> Anyhow, there is hopefully enough info in there for them to figure 
>>> out what's up (my guess is that the missing cast is the likely 
>>> culprit, as it caused similar misbehavior in evolution some time back).
>>>     
>>
>> Undo all your seahorse changes, then try this patch to gnome-keyring.
>>
>> Joe
>>
>>   
> I now get a crash with the following backtrace:
> (gdb) bt
> #0  0x0000000806c047ee in pthread_mutex_getyieldloops_np () from 
> /lib/libthr.so.3
> #1  0x0000000803198b06 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #2  0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #3  0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #4  0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #5  0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #6  0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #7  0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #8  0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #9  0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #10 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #11 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #12 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #13 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #14 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #15 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #16 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #17 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #18 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #19 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #20 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #21 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #22 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #23 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #24 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #25 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #26 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #27 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #28 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #29 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #30 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #31 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #32 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #33 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #34 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #35 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #36 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #37 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #38 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #39 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #40 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #41 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #42 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #43 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #44 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #45 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #46 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #47 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #48 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #49 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #50 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #51 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #52 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #53 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #54 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> #55 0x0000000803198d12 in gnome_keyring_found_free () from 
> /usr/local/lib/libgnome-keyring.so.0
> #56 0x0000000000427bd3 in switch_calloc (num=1, size=17) at 
> seahorse-secure-memory.c:58
> #57 0x00000008063ff2b3 in g_malloc0 () from 
> /usr/local/lib/libglib-2.0.so.0
> ...
>
> The alternatic g_malloc->switch_calloc->gnome_keyring_found_free calls 
> repeat ad infinum, leading me to believe that seahorse has managed to 
> plug it's "secure g_malloc" into glib so that other linked code also 
> attempts to use the g_malloc implementation provided by seahorse. 
> Somehow, I suppose that gnome_keyring_found_free is going to have to 
> not use the seahorse-provided g_malloc...or it is going to need to 
> tell seahorse to disable that feature.
>
> Maybe we can have seahorse-agent attempt a test at startup, and 
> populate some "gboolean has_secure_mem" with TRUE or FALSE. Then, in 
> the seahorse WITH_SECURE_MEM, it performs:
>  seahorse_use_secure_mem = has_secure_mem;
>
> ???
>
> I believe that seahorse_secure_memory_init in seahorse-secure-memory.c 
> is where the glib malloc functions get overridden. Of course, is a 
> secured environment this is the ideal operation....
>
> If we could hook it such that seahorse detects the lack of secured 
> memory prior to calling seahorse_secure_memory_init, then we can 
> conditionally call that _init function in the cases where we have 
> secure memory.
>
> -- 
> Coleman Kane
I removed your earleir patch, which has the side effect of causing 
gnome_keyring_memory_try_alloc(size) to act in a manner that violates 
its documentation, as well as causing the above bug. I then added the 
three patches to security/seahorse which I posted into 
http://bugzilla.gnome.org/show_bug.cgi?id=527193 today:
  * http://bugzilla.gnome.org/attachment.cgi?id=109055
  * http://bugzilla.gnome.org/attachment.cgi?id=109056
  * http://bugzilla.gnome.org/attachment.cgi?id=109057

These three alter the behavior of Seahorse in the manner I described 
above, and don't touch gnome-keyring. For all purposes, I *think* 
gnome-keyring is acting properly here. The consumer of gnome-keyring 
(seahorse) should first be testing if the features that it wants to use 
are actually provided by the library before it blindingly attempts to 
use them. This is, IMHO, why gnome-keyring provides the *_try(...) 
versions of its securemem alloc functions.

Additionally, you'll get a seahorse g_warning about unavailable secure 
memory now too.

--
Coleman Kane



More information about the freebsd-gnome mailing list