HomeFreeBSD

crypt_r(3): fix reentrancy problems with DES

Description

crypt_r(3): fix reentrancy problems with DES

This code was originally written for non-reentrant crypt(3).
In 5f521d7ba72, a thread-safe crypt_r(3) was introduced. However,
it looks like the DES implementation is still not re-entrant;
routines like setup_salt() or des_setkey() still use global
variables.

Instead of something drastic, eg removing DES support altogether,
just mark those variables as thread-local. This adds about 30kB
of data per thread.

Given that this only applies to DES, I think the impact is minimal.

Reviewed By: markj
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D30674

Details

Provenance
traszAuthored on Jun 15 2021, 10:04 AM
Reviewer
markj
Differential Revision
D30674: crypt_r(3): fix reentrancy problems with DES
Parents
rG9d167945e840: linux: improve reporting for unsupported syscall flags
Branches
Unknown
Tags
Unknown