Comments (3)
Okay the problem lies in the following order:
src/lib/session.c , session_open line 70:
session_table_lock(global.s_table);
session_table_lock now holds global.s_table mutex
line 71:
rv = check_max_sessions(is_rw);
which calls
static CK_RV check_max_sessions(bool is_rw) {
unsigned long cnt = session_table_get_cnt(global.s_table, is_rw);
return (cnt > MAX_NUM_OF_SESSIONS) ?
CKR_SESSION_COUNT : CKR_OK;
}
which calls
unsigned long session_table_get_cnt(session_table *t, bool is_rw) {
session_table_lock(t);
unsigned long tmp = is_rw ? t->rw_cnt : t->cnt;
session_table_unlock(t);
return tmp;
}
--> session_table_get_cnt wants to take the mutex again on global.s_table (which is already held)
-> deadlock.
Question is whether the locking in session_open can simply be removed?
from tpm2-pkcs11.
I think you need to remove the locking from session_table_get_cnt()
. The lock on the session table is required when adding an entry via session_table_new_ctx_unlocked()
. Probably make a new session_table_get_count_unlocked()
or something like that.
I am also OK with a general refactoring of the session code layout, not happy with how that currently turned out.
FYI: I have a --debug
in configure that should use a PTHREAD_MUTEX_ERRORCHECK
attributed thread.
from tpm2-pkcs11.
This seems to be fixed in #47 and #48
from tpm2-pkcs11.
Related Issues (20)
- SSHFS with tpm2
- 1.9.0: test/integration/pkcs11-tool fails
- Openssl3 HOT 1
- cannot connect to SSH after reboot HOT 1
- tpm2_ptool - Undefined sybol: TSS2_MU_TPMS_ALGORITHM_DESCRIPTION_Marshal HOT 12
- Error while decrypting in padding mode
- Failure when trying to create a new rsa key with the tpm2_pkcs11 module. HOT 1
- Multiple sessions open -> sign loop -> failure
- C_SignInit() Failed with `CKR_USER_NOT_LOGGED_IN ` with multiple sessions open on the same token
- Segmentation fault during database upgrade 7 -> 8 HOT 5
- tpm2-pkcs11 emits NULL byte padded model numbers
- Make Hierarchy a configurable option HOT 2
- Github code signing using SSH keys stored in tpm HOT 1
- Multiple keys / Specific key selection for SSH HOT 1
- Allow specification of a PIN from a file
- Not able to do activate credential on pkcs11 key objects added using tpm2_ptool while tpm2_create objects works file. HOT 7
- tpm2-ptool import error HOT 2
- Release tarball doesn't contain wrap_tpm.h
- Support for C_CopyObject
- SSL connection failure: PKCS #11 error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tpm2-pkcs11.