[virt-tools-list] [virt-viewer 1/2] Add VirtViewerSession::software-smartcard-reader property

Marc-André Lureau marcandre.lureau at gmail.com
Thu Jul 24 15:21:51 UTC 2014


On Mon, Jun 24, 2013 at 5:19 PM, Christophe Fergeau <cfergeau at redhat.com>
wrote:

> +    if (smartcard_manager) {
> +        GList *readers;
> +        GList *it;
> +        g_signal_connect(smartcard_manager, "reader-added",
> +                         (GCallback)reader_added_cb, self);
> +        g_signal_connect(smartcard_manager, "reader-removed",
> +                         (GCallback)reader_removed_cb, self);
> +        readers = spice_smartcard_manager_get_readers(smartcard_manager);
> +        for (it = readers; it != NULL; it = it->next) {
> +            SpiceSmartcardReader *reader;
>


This code is not safe and can crash with windows build:

#0  0x7c919af2 in ntdll!RtlpWaitForCriticalSection ()
   from C:\WINDOWS\system32\ntdll.dll
#1  0x7c901046 in ntdll!RtlEnterCriticalSection ()
   from C:\WINDOWS\system32\ntdll.dll
#2  0x0034903c in ?? ()
#3  0x03339ad0 in _fu458____stack_chk_guard ()
    at /home/user/pkg/mingw-qemu/qemu-1.4.0/util/qemu-thread-win32.c:44
#4  0x03333c03 in _fu187____stack_chk_guard ()
    at /home/user/pkg/mingw-qemu/qemu-1.4.0/libcacard/vreader.c:351
#5  0x03333d03 in _fu193____stack_chk_guard ()
    at /home/user/pkg/mingw-qemu/qemu-1.4.0/libcacard/vreader.c:386
#6  0x00f17061 in spice_smartcard_manager_get_readers (manager=0x55c4d98)
    at ../../gtk/smartcard-manager.c:619
#7  0x004177ab in create_spice_session (self=0x55e0378)
    at ../../src/virt-viewer-session-spice.c:269
#8  0x00419d68 in virt_viewer_session_spice_new (app=0x55cf068,
    main_window=0x55df000) at ../../src/virt-viewer-session-spice.c:859
#9  0x0040492e in virt_viewer_app_create_session (self=0x55cf068,
    type=0x565e058 "spice") at ../../src/virt-viewer-app.c:908
#10 0x0041d5ac in remote_viewer_start (app=0x55cf068)
    at ../../src/remote-viewer.c:1020
#11 0x004060d4 in virt_viewer_app_start (self=0x55cf068)
    at ../../src/virt-viewer-app.c:1548
#12 0x0041dddf in main (argc=1, argv=0x53b70e8)
    at ../../src/remote-viewer-main.c:173

It seems to be missing a call to vreader_init(), called from
vcard_emul_init() in smartcard_manager_init()_async()


-- 
Marc-André Lureau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20140724/273f8ed0/attachment.htm>


More information about the virt-tools-list mailing list