From 88ce22ed953e4153e8c49497b118265226a2607b Mon Sep 17 00:00:00 2001 From: Alek P Date: Wed, 21 Jan 2026 13:00:34 -0500 Subject: [PATCH] remove thread unsafe debug code causing FreeBSD double free panic Reviewed-by: Brian Behlendorf Reviewed-by: Alan Somers Signed-off-by: Alek Pinchuk Closes #18140 --- module/os/freebsd/zfs/zio_crypt.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/module/os/freebsd/zfs/zio_crypt.c b/module/os/freebsd/zfs/zio_crypt.c index 91cf38016..1eb0d3f03 100644 --- a/module/os/freebsd/zfs/zio_crypt.c +++ b/module/os/freebsd/zfs/zio_crypt.c @@ -371,9 +371,6 @@ error: return (ret); } -void *failed_decrypt_buf; -int failed_decrypt_size; - /* * This function handles all encryption and decryption in zfs. When * encrypting it expects puio to reference the plaintext and cuio to @@ -1663,9 +1660,6 @@ error: return (ret); } -void *failed_decrypt_buf; -int faile_decrypt_size; - /* * Primary encryption / decryption entrypoint for zio data. */ @@ -1758,13 +1752,6 @@ zio_do_crypt_data(boolean_t encrypt, zio_crypt_key_t *key, return (0); error: - if (!encrypt) { - if (failed_decrypt_buf != NULL) - kmem_free(failed_decrypt_buf, failed_decrypt_size); - failed_decrypt_buf = kmem_alloc(datalen, KM_SLEEP); - failed_decrypt_size = datalen; - memcpy(failed_decrypt_buf, cipherbuf, datalen); - } if (locked) rw_exit(&key->zk_salt_lock); if (authbuf != NULL)