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
Created attachment 1275603 [details] File: backtrace
Created attachment 1275605 [details] File: cgroup
Created attachment 1275606 [details] File: core_backtrace
Created attachment 1275607 [details] File: dso_list
Created attachment 1275608 [details] File: environ
Created attachment 1275609 [details] File: exploitable
Created attachment 1275610 [details] File: limits
Created attachment 1275611 [details] File: maps
Created attachment 1275612 [details] File: mountinfo
Created attachment 1275613 [details] File: namespaces
Created attachment 1275614 [details] File: open_fds
Created attachment 1275615 [details] File: proc_pid_status
Created attachment 1275616 [details] File: var_log_messages
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.
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
The problem is solved with the version provided
opensc-0.16.0-2.20161016git0362439.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-b5e1a96d72
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
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.