Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jul 2013 08:31:41 GMT
From:      Marcin Cieslak <saper@saper.info>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        ale@freebsd.org
Subject:   ports/180291: [PATCH] security/openct: don't crash when backed cannot be signalled
Message-ID:  <201307050831.r658Vf9G011912@radziecki.saper.info>
Resent-Message-ID: <201307050840.r658e1OR015348@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         180291
>Category:       ports
>Synopsis:       [PATCH] security/openct: don't crash when backed cannot be signalled
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 05 08:40:01 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Marcin Cieslak
>Release:        FreeBSD 10.0-CURRENT amd64
>Organization:
http://saper.info
>Environment:
System: FreeBSD radziecki.saper.info 10.0-CURRENT FreeBSD 10.0-CURRENT #2 r241671M: Thu Oct 18 09:38:06 CEST
>Description:

My pcscd could not communicate with ifd because some problems
when attaching to the ccid ifdhandler of openct (I am using
PCMCIA Omnikey 4040 card reader via cmx(4)).

It crashed when trying to initialize the handler.
A patch attached fixes the crash I got.

The original problem must have been somewhere else (wrong
permissions/stale PID number of the handler) but nevertheless
at least now we get an error message instead of the crash.

Added file(s):
- files/patch-ctapi.c

Port maintainer (ale@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- openct-0.6.20.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/security/openct.orig/files/patch-ctapi.c /usr/ports/security/openct/files/patch-ctapi.c
--- /usr/ports/security/openct.orig/files/patch-ctapi.c	1970-01-01 01:00:00.000000000 +0100
+++ /usr/ports/security/openct/files/patch-ctapi.c	2013-07-05 10:23:33.000000000 +0200
@@ -0,0 +1,15 @@
+--- src/ctapi/ctapi.c	2006-04-25 23:58:06.000000000 +0200
++++ src/ctapi/ctapi.c	2013-07-05 10:08:41.000000000 +0200
+@@ -562,7 +562,11 @@
+ 	ct->next = cardTerminals;
+ 	cardTerminals = ct;
+ 	ct->cwd = &ct->mf;
+-	ct_reader_info(pn, &info);
++	if (ct_reader_info(pn, &info) < 0) { 
++		free(ct);
++		ct_error("ct_reader_info failed\n");
++		return ERR_INVALID;
++	}
+ 	ct->mf.id = 0x3f00;
+ 	ct->mf.gen = dir;
+ 	ct->mf.dir[0] = &ct->mf;
--- openct-0.6.20.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307050831.r658Vf9G011912>