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 696305 - Crash when hashing unknown/invalid attribute
Crash when hashing unknown/invalid attribute
Status: RESOLVED FIXED
Product: gcr
Classification: Core
Component: gck
3.7.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-03-21 16:46 UTC by Bastien Nocera
Modified: 2019-03-23 21:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gck: Fix crash when hashing an unsupported attributes (3.10 KB, patch)
2013-03-21 17:33 UTC, Stef Walter
accepted-commit_after_freeze Details | Review
gck: Fix crash when hashing an unsupported attributes (2.81 KB, patch)
2013-03-22 10:44 UTC, Stef Walter
none Details | Review

Description Bastien Nocera 2013-03-21 16:46:08 UTC
seahorse-3.7.91-1.fc19.x86_64
gcr-3.7.92-1.fc19.x86_64

p11-kit: duplicate 'StartCom Certification Authority' certificate found in: ca-bundle.trust.crt
p11-kit: duplicate 'Class 3 Public Primary Certification Authority' certificate found in: ca-bundle.trust.crt

Program received signal SIGSEGV, Segmentation fault.
gck_attribute_hash (attr=0xc94d38) at gck-attributes.c:2000
2000			h = (h << 5) + h + *p;
Missing separate debuginfos, use: debuginfo-install GConf2-3.2.6-2.fc19.x86_64 PackageKit-gtk3-module-0.8.7-3.fc19.x86_64 adwaita-gtk3-theme-3.7.92-1.fc19.x86_64 at-spi2-atk-2.7.91-1.fc19.x86_64 at-spi2-core-2.7.91-1.fc19.x86_64 atk-2.7.91-1.fc19.x86_64 avahi-glib-0.6.31-11.fc19.x86_64 avahi-libs-0.6.31-11.fc19.x86_64 cairo-1.12.14-1.fc19.x86_64 cairo-gobject-1.12.14-1.fc19.x86_64 cyrus-sasl-lib-2.1.26-6.fc19.x86_64 dbus-glib-0.100-3.fc19.x86_64 dbus-libs-1.6.8-4.fc19.x86_64 dconf-0.15.3-1.fc19.x86_64 expat-2.1.0-5.fc19.x86_64 fontconfig-2.10.91-3.fc19.x86_64 freetype-2.4.11-3.fc19.x86_64 gdk-pixbuf2-2.27.3-1.fc19.x86_64 glib2-2.35.9-1.fc19.x86_64 glibc-2.17-4.fc19.x86_64 gnome-keyring-3.7.92-1.fc19.x86_64 gpgme-1.3.2-3.fc19.x86_64 gtk3-3.7.14-1.fc19.x86_64 gvfs-1.15.4-2.fc19.x86_64 harfbuzz-0.9.13-1.fc19.x86_64 libX11-1.5.99.901-2.fc19.x86_64 libXau-1.0.6-7.fc19.x86_64 libXcomposite-0.4.4-3.fc19.x86_64 libXcursor-1.1.13-4.fc19.x86_64 libXdamage-1.1.4-3.fc19.x86_64 libXext-1.3.1-4.fc19.x86_64 libXfixes-5.0-5.fc19.x86_64 libXi-1.7-1.fc19.x86_64 libXinerama-1.1.2-4.fc19.x86_64 libXrandr-1.4.0-3.fc19.x86_64 libXrender-0.9.7-4.fc19.x86_64 libXxf86vm-1.1.2-4.fc19.x86_64 libassuan-2.0.3-5.fc19.x86_64 libbluray-0.2.3-2.fc19.x86_64 libcanberra-0.30-3.fc19.x86_64 libcanberra-gtk3-0.30-3.fc19.x86_64 libcroco-0.6.8-2.fc19.x86_64 libffi-3.0.11-2.fc19.x86_64 libgcc-4.8.0-0.18.fc19.x86_64 libgcrypt-1.5.1-1.fc19.x86_64 libgpg-error-1.10-4.fc19.x86_64 libicu-50.1.2-5.fc19.x86_64 libogg-1.3.0-3.fc19.x86_64 libpng-1.5.13-2.fc19.x86_64 librsvg2-2.37.0-2.fc19.x86_64 libsecret-0.15-1.fc19.x86_64 libselinux-2.1.13-11.fc19.x86_64 libsoup-2.41.92-1.fc19.x86_64 libstdc++-4.8.0-0.18.fc19.x86_64 libtasn1-3.2-3.fc19.x86_64 libtdb-1.2.11-2.fc19.x86_64 libtool-ltdl-2.4.2-12.fc19.x86_64 libvorbis-1.3.3-4.fc19.x86_64 libxcb-1.9-2.fc19.x86_64 libxkbcommon-0.2.0-2.fc19.x86_64 libxml2-2.9.0-4.fc19.x86_64 mesa-libEGL-9.1-3.fc19.x86_64 mesa-libGL-9.1-3.fc19.x86_64 mesa-libgbm-9.1-3.fc19.x86_64 mesa-libglapi-9.1-3.fc19.x86_64 nspr-4.9.5-2.fc19.x86_64 nss-3.14.3-10.fc19.x86_64 nss-softokn-freebl-3.14.3-1.fc19.x86_64 nss-util-3.14.3-1.fc19.x86_64 openldap-2.4.34-1.fc19.x86_64 p11-kit-0.17.4-1.fc19.x86_64 p11-kit-trust-0.17.4-1.fc19.x86_64 pango-1.33.9-1.fc19.x86_64 pcre-8.32-4.fc19.x86_64 pixman-0.28.0-3.fc19.x86_64 sqlite-3.7.15.2-2.fc19.x86_64 systemd-libs-198-7.fc19.x86_64 xz-libs-5.1.2-4alpha.fc19.x86_64 zlib-1.2.7-10.fc19.x86_64
(gdb) bt
  • #0 gck_attribute_hash
    at gck-attributes.c line 2000
  • #1 g_hash_table_lookup_extended
    from /lib64/libglib-2.0.so.0
  • #2 update_id_map
    at seahorse-token.c line 139
  • #3 receive_objects
    at seahorse-token.c line 278
  • #4 on_refresh_next_objects
    at seahorse-token.c line 375
  • #5 process_result
    at gck-call.c line 152
  • #6 process_completed
    at gck-call.c line 166
  • #7 completed_dispatch
    at gck-call.c line 198
  • #8 g_main_context_dispatch
    from /lib64/libglib-2.0.so.0
  • #9 g_main_context_iterate.isra.22
    from /lib64/libglib-2.0.so.0
  • #10 g_main_context_iteration
    from /lib64/libglib-2.0.so.0
  • #11 g_application_run
    from /lib64/libgio-2.0.so.0
  • #12 main
    at seahorse-main.c line 63
$1 = (const signed char *) 0x0


Let me know if you want more debug.
Comment 1 Stef Walter 2013-03-21 17:33:16 UTC
Created attachment 239485 [details] [review]
gck: Fix crash when hashing an unsupported attributes

PKCS#11 modules return attributes with a negative length and a
NULL value, when they don't support the attribute in question.
Comment 2 Stef Walter 2013-03-21 17:34:10 UTC
Could you test the attach patch to the gcr library?
Comment 3 Bastien Nocera 2013-03-21 17:46:59 UTC
Works for me.
Comment 4 Stef Walter 2013-03-21 20:15:51 UTC
Review of attachment 239485 [details] [review]:

::: gck/tests/test-gck-attributes.c
@@ +43,3 @@
 	GckAttribute attr;
 
+	g_assert (sizeof (attr) == sizeof (GckAttribute));

Ooops this snuck in accidentally.
Comment 5 Stef Walter 2013-03-22 10:44:59 UTC
Created attachment 239531 [details] [review]
gck: Fix crash when hashing an unsupported attributes

PKCS#11 modules return attributes with a negative length and a
NULL value, when they don't support the attribute in question.
Comment 6 Stef Walter 2013-03-22 10:49:13 UTC
Pushed to git master and gnome-3-6 branches.