After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 549087 - gdmgreeter segfault
gdmgreeter segfault
Status: RESOLVED FIXED
Product: librsvg
Classification: Core
Component: general
1.0.1
Other Linux
: Normal critical
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2008-08-23 06:17 UTC by Priit Laes (IRC: plaes)
Modified: 2008-10-20 14:26 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Uses xmlNewEntity for libxml >= 2.7 (1.98 KB, patch)
2008-09-19 13:35 UTC, palfrey
none Details | Review

Description Priit Laes (IRC: plaes) 2008-08-23 06:17:08 UTC
Hey, I'm getting following segfault with gdmgreeter from gdm-2.20.7

Core was generated by `/usr/libexec/gdmgreeter'.
Program terminated with signal 11, Segmentation fault.
[New process 24277]
  • #0 _int_free
    at malloc.c line 4681
  • #0 _int_free
    at malloc.c line 4681
  • #1 *__GI___libc_free
    at malloc.c line 3625
  • #2 xmlParseEntityDecl__internal_alias
    at parser.c line 4809
  • #3 xmlParseMarkupDecl__internal_alias
    at parser.c line 5947
  • #4 xmlParseInternalSubset
    at parser.c line 7310
  • #5 xmlParseChunk__internal_alias
    at parser.c line 10782
  • #6 rsvg_handle_write_impl
    at rsvg-base.c line 1061
  • #7 rsvg_pixbuf_from_file_with_size_data
    at rsvg-file-util.c line 168
  • #8 rsvg_pixbuf_from_file_at_size
    at rsvg-file-util.c line 321
  • #9 greeter_item_size_request
    at greeter_geometry.c line 558
  • #10 greeter_size_allocate_fixed
    at greeter_geometry.c line 146
  • #11 main
    at greeter.c line 1554

Comment 1 Priit Laes (IRC: plaes) 2008-08-23 12:39:19 UTC
Apparently seems to be caused by recent security patch in libxml2.
Comment 2 Mart Raudsepp 2008-08-23 13:01:29 UTC
Yes, a security patch that I applied to Gentoo Linux libxml2-2.6.32 and the patch is off of CVE probably, not libxml2 upstream. Assessing the situation now.
Our bug for libxml2 security is http://bugs.gentoo.org/show_bug.cgi?id=234099 and the patch we applied that broke it (confirmed with a downgrade) is http://bugs.gentoo.org/attachment.cgi?id=162889
Comment 3 Mart Raudsepp 2008-08-23 13:36:32 UTC
The patch we are applying is identical to what was applied to libxml2 SVN after checking. Just line numbers are shifted for some files due to other changes in SVN.
Comment 4 Priit Laes (IRC: plaes) 2008-08-23 16:00:16 UTC
The crash didn't occur also when I downgraded librsvg from 2.22.2 to 2.20.0.
Comment 5 Mart Raudsepp 2008-08-23 16:19:48 UTC
Seems like Daniel is already aware of this per
https://bugzilla.redhat.com/show_bug.cgi?id=459830
Comment 6 Daniel Veillard 2008-08-24 07:47:00 UTC
Yes and I think librsvg made a big mistake by not using the libxml2
APIs to allocate an entity node. So I plan to keep the given bug fix
in libxml2-2.7.0 probably out next week, but to avoid the problem
in librsvg it really should be fixed to use libxml2 allocation APIs
(or explain why they can't use libxml2 APIs which I would try to fix).

 I still consider this as much a librsvg bug as a libxml2 problem.
Reassigning to librsvg so that rsvg_entity_decl() is fixed to call
xmlAddDocEntity() or xmlAddDtdEntity() possibly with a first NULL arg

Daniel
Comment 7 Mart Raudsepp 2008-08-24 19:01:39 UTC
We do need a upstream supported ABI compatible security fix for 2.6 though... I see some in the redhat bug, which should go to libxml2-2.6?
That isn't to say I'm happy about an ABI break in 2.7, at least not if that doesn't go along with a major library soname version bump.
Comment 8 Daniel Veillard 2008-08-25 12:50:07 UTC
soname bump ... no way, sorry, no way
I will keep the ABI in 2.7.0
I will provide you an xmlNewEntity() you will be able to use
but I require that you fix librsvg code with that new entry point
when 2.7.0 is fixed
And I will note that the xmlEntity structure had grown between 2.6.26 and
2.6.32 (adding the checked field) and nobody complained then.
Comment 9 Dominic Lachowicz 2008-08-25 14:18:38 UTC
Patches to librsvg are welcomed.
Comment 10 palfrey 2008-09-19 13:35:07 UTC
Created attachment 118998 [details] [review]
Uses xmlNewEntity for libxml >= 2.7

When compiled with libxml >= 2.7, this patch uses the new xmlNewEntity call. Compiling with < 2.7 uses the old code.
Comment 11 Daniel Veillard 2008-09-23 21:25:13 UTC
from the distance, that patch seems to do the right thing,
except I think you still need to deallocate the entities since
they don't seems linked to a document
 self->priv->entities
cleanup should be maintained but just modified to use xmlFreeNode()
on them.

Daniel
Comment 12 Dominic Lachowicz 2008-10-20 14:26:39 UTC
Thanks, Tom, DV. I committed the patch with a change to use xmlFreeNode. I don't use libxml2 >= 2.7, so I didn't personally test that part, but trust that Tom's tested it and that DV's cursory look at the patch is a good first approximation of correctness.