Home GnuPG
Diffusion GnuPG c48cf7e32ffa

scd: Fix a race condition for new_reader_slot.
c48cf7e32ffaUnpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

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>

Details

Provenance
gniibeAuthored on Dec 29 2016, 2:07 AM
Parents
rG4cc9fc5eb9bd: scd: APP centric approach for device management.
Branches
Unknown
Tags
Unknown

Event Timeline

NIIBE Yutaka <gniibe@fsij.org> committed rGc48cf7e32ffa: scd: Fix a race condition for new_reader_slot. (authored by NIIBE Yutaka <gniibe@fsij.org>).Dec 29 2016, 2:07 AM