From: John Baldwin Date: Thu, 7 Jan 2021 22:09:41 +0000 (-0800) Subject: Close /dev/crypto file descriptor after CRIOGET ioctl(). X-Git-Tag: OpenSSL_1_1_1k~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a12c6442f24a32867c971b6feb5db61d01b02c1f;p=thirdparty%2Fopenssl.git Close /dev/crypto file descriptor after CRIOGET ioctl(). Reviewed-by: Matt Caswell Reviewed-by: Ben Kaduk (cherry picked from commit 3ddf44ea5a2c1c8c55f4f4072a611791c79d4e7c) Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/13853) --- diff --git a/crypto/engine/eng_devcrypto.c b/crypto/engine/eng_devcrypto.c index f03c0171813..997271e1505 100644 --- a/crypto/engine/eng_devcrypto.c +++ b/crypto/engine/eng_devcrypto.c @@ -771,9 +771,11 @@ void engine_load_devcrypto_int() #ifdef CRIOGET if (ioctl(fd, CRIOGET, &cfd) < 0) { fprintf(stderr, "Could not create crypto fd: %s\n", strerror(errno)); + close(fd); cfd = -1; return; } + close(fd); #else cfd = fd; #endif