Bug 1447244 - [abrt] opensc: sc_file_free(): pkcs15-tool killed by SIGSEGV
Summary: [abrt] opensc: sc_file_free(): pkcs15-tool killed by SIGSEGV
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: opensc
Version: 25
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelen
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:95f15b7f71c0e322a9bf5f30781...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-02 08:30 UTC by Eric COUTURIER-GUILLAUME
Modified: 2017-05-16 06:00 UTC (History)
5 users (show)

Fixed In Version: opensc-0.16.0-2.20161016git0362439.fc25
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-16 06:00:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (16.81 KB, text/plain)
2017-05-02 08:30 UTC, Eric COUTURIER-GUILLAUME
no flags Details
File: cgroup (242 bytes, text/plain)
2017-05-02 08:30 UTC, Eric COUTURIER-GUILLAUME
no flags Details
File: core_backtrace (2.55 KB, text/plain)
2017-05-02 08:30 UTC, Eric COUTURIER-GUILLAUME
no flags Details
File: dso_list (824 bytes, text/plain)
2017-05-02 08:30 UTC, Eric COUTURIER-GUILLAUME
no flags Details
File: environ (3.23 KB, text/plain)
2017-05-02 08:30 UTC, Eric COUTURIER-GUILLAUME
no flags Details
File: exploitable (112 bytes, text/plain)
2017-05-02 08:30 UTC, Eric COUTURIER-GUILLAUME
no flags Details
File: limits (1.29 KB, text/plain)
2017-05-02 08:30 UTC, Eric COUTURIER-GUILLAUME
no flags Details
File: maps (4.43 KB, text/plain)
2017-05-02 08:30 UTC, Eric COUTURIER-GUILLAUME
no flags Details
File: mountinfo (3.74 KB, text/plain)
2017-05-02 08:30 UTC, Eric COUTURIER-GUILLAUME
no flags Details
File: namespaces (102 bytes, text/plain)
2017-05-02 08:30 UTC, Eric COUTURIER-GUILLAUME
no flags Details
File: open_fds (193 bytes, text/plain)
2017-05-02 08:30 UTC, Eric COUTURIER-GUILLAUME
no flags Details
File: proc_pid_status (1.28 KB, text/plain)
2017-05-02 08:30 UTC, Eric COUTURIER-GUILLAUME
no flags Details
File: var_log_messages (315 bytes, text/plain)
2017-05-02 08:30 UTC, Eric COUTURIER-GUILLAUME
no flags Details

Description Eric COUTURIER-GUILLAUME 2017-05-02 08:30:15 UTC
Description of problem:
Problem while reading a card on a Feitian SCR310

Version-Release number of selected component:
opensc-0.16.0-1.fc25

Additional info:
reporter:       libreport-2.8.0
backtrace_rating: 4
cmdline:        pkcs15-tool --list-keys
crash_function: sc_file_free
executable:     /usr/bin/pkcs15-tool
global_pid:     41207
kernel:         4.10.12-200.fc25.x86_64
pkg_fingerprint: 4089 D8F2 FDB1 9C98
pkg_vendor:     Fedora Project
runlevel:       N 5
type:           CCpp
uid:            1000

Truncated backtrace:
Thread no. 1 (8 frames)
 #0 sc_file_free at sc.c:541
 #1 entersafe_select_fid at card-entersafe.c:496
 #2 entersafe_select_path at card-entersafe.c:665
 #3 entersafe_select_file at card-entersafe.c:702
 #4 sc_select_file at card.c:719
 #5 sc_enum_apps at dir.c:172
 #6 sc_pkcs15_bind_internal at pkcs15.c:994
 #7 sc_pkcs15_bind at pkcs15.c:1233

Comment 1 Eric COUTURIER-GUILLAUME 2017-05-02 08:30:22 UTC
Created attachment 1275603 [details]
File: backtrace

Comment 2 Eric COUTURIER-GUILLAUME 2017-05-02 08:30:24 UTC
Created attachment 1275605 [details]
File: cgroup

Comment 3 Eric COUTURIER-GUILLAUME 2017-05-02 08:30:25 UTC
Created attachment 1275606 [details]
File: core_backtrace

Comment 4 Eric COUTURIER-GUILLAUME 2017-05-02 08:30:27 UTC
Created attachment 1275607 [details]
File: dso_list

Comment 5 Eric COUTURIER-GUILLAUME 2017-05-02 08:30:29 UTC
Created attachment 1275608 [details]
File: environ

Comment 6 Eric COUTURIER-GUILLAUME 2017-05-02 08:30:31 UTC
Created attachment 1275609 [details]
File: exploitable

Comment 7 Eric COUTURIER-GUILLAUME 2017-05-02 08:30:32 UTC
Created attachment 1275610 [details]
File: limits

Comment 8 Eric COUTURIER-GUILLAUME 2017-05-02 08:30:34 UTC
Created attachment 1275611 [details]
File: maps

Comment 9 Eric COUTURIER-GUILLAUME 2017-05-02 08:30:36 UTC
Created attachment 1275612 [details]
File: mountinfo

Comment 10 Eric COUTURIER-GUILLAUME 2017-05-02 08:30:37 UTC
Created attachment 1275613 [details]
File: namespaces

Comment 11 Eric COUTURIER-GUILLAUME 2017-05-02 08:30:39 UTC
Created attachment 1275614 [details]
File: open_fds

Comment 12 Eric COUTURIER-GUILLAUME 2017-05-02 08:30:41 UTC
Created attachment 1275615 [details]
File: proc_pid_status

Comment 13 Eric COUTURIER-GUILLAUME 2017-05-02 08:30:42 UTC
Created attachment 1275616 [details]
File: var_log_messages

Comment 14 Jakub Jelen 2017-05-02 08:59:41 UTC
I don't have that card so I can not reproduce the crash.

Can you provide the debug log from the command you ran with environment variable OPENSC_DEBUG=9 set (with removed PINs or whatever personal data will be there -- or to my email if you don't trust bugzilla)? I don't see any significant change since the 0.16.0 release in this code but it would be good to find out what is wrong there to get it fixed upstream.

Comment 15 Jakub Jelen 2017-05-02 09:11:46 UTC
ok, upstream added the following check:

@@ -529,7 +556,8 @@ sc_file_t * sc_file_new(void)
 void sc_file_free(sc_file_t *file)
 {
        unsigned int i;
-       assert(sc_file_valid(file));
+       if (file == NULL || !sc_file_valid(file))
+               return;
        file->magic = 0;
        for (i = 0; i < SC_MAX_AC_OPS; i++)
                sc_file_clear_acl_entries(file, i);

which should resolve the problem. I will try to update Fedora 25 to the same git snapshot which is in Fedora 26 already.

Can you try the following scratch build if it resolves your problems:
https://koji.fedoraproject.org/koji/taskinfo?taskID=19366730

Comment 16 Eric COUTURIER-GUILLAUME 2017-05-02 09:31:45 UTC
The problem is solved with the version provided

Comment 17 Fedora Update System 2017-05-02 10:45:53 UTC
opensc-0.16.0-2.20161016git0362439.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-b5e1a96d72

Comment 18 Fedora Update System 2017-05-04 15:24:06 UTC
opensc-0.16.0-2.20161016git0362439.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-b5e1a96d72

Comment 19 Fedora Update System 2017-05-05 21:00:31 UTC
opensc-0.16.0-2.20161016git0362439.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-b5e1a96d72

Comment 20 Fedora Update System 2017-05-16 06:00:40 UTC
opensc-0.16.0-2.20161016git0362439.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.