summaryrefslogtreecommitdiffstats
path: root/scd/scdaemon.h
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2016-12-29 02:07:43 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2016-12-29 02:07:43 +0100
commitc48cf7e32ffa02ebdf00265543344c611bef0431 (patch)
tree3c019efcce4b10bdb9077a76e7fd6bbfde683581 /scd/scdaemon.h
parentscd: APP centric approach for device management. (diff)
downloadgnupg2-c48cf7e32ffa02ebdf00265543344c611bef0431.tar.xz
gnupg2-c48cf7e32ffa02ebdf00265543344c611bef0431.zip
scd: Fix a race condition for new_reader_slot.
* scd/apdu.c (reader_table_lock, apdu_init): New. (new_reader_slot): Serialize by reader_table_lock. * scd/app.c (lock_app, unlock_app, app_new_register): Fix error code usage. (initialize_module_command): Call apdu_init. * scd/scdaemon.c (main): Handle error for initialize_module_command. -- This is a long standing bug. There are two different things; The serialization of allocating a new SLOT, and the serialization of using the SLOT. The latter was implemented in new_reader_slot by lock_slot. However, the former was not done. Thus, there was a possible race where a same SLOT is allocated to multiple threads. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'scd/scdaemon.h')
-rw-r--r--scd/scdaemon.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/scd/scdaemon.h b/scd/scdaemon.h
index e18ebfe4c..22b17b49e 100644
--- a/scd/scdaemon.h
+++ b/scd/scdaemon.h
@@ -118,7 +118,7 @@ void scd_exit (int rc);
const char *scd_get_socket_name (void);
/*-- command.c --*/
-void initialize_module_command (void);
+gpg_error_t initialize_module_command (void);
int scd_command_handler (ctrl_t, int);
void send_status_info (ctrl_t ctrl, const char *keyword, ...)
GPGRT_ATTR_SENTINEL(1);