Skip to content

Commit 990d4e5

Browse files
alek-pamotin
authored andcommitted
remove thread unsafe debug code causing FreeBSD double free panic
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alan Somers <asomers@gmail.com> Signed-off-by: Alek Pinchuk <apinchuk@axcient.com> Closes openzfs#18140
1 parent 1ffad96 commit 990d4e5

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

module/os/freebsd/zfs/zio_crypt.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,6 @@ zio_crypt_key_get_salt(zio_crypt_key_t *key, uint8_t *salt)
371371
return (ret);
372372
}
373373

374-
void *failed_decrypt_buf;
375-
int failed_decrypt_size;
376-
377374
/*
378375
* This function handles all encryption and decryption in zfs. When
379376
* encrypting it expects puio to reference the plaintext and cuio to
@@ -1665,9 +1662,6 @@ zio_crypt_init_uios(boolean_t encrypt, uint64_t version, dmu_object_type_t ot,
16651662
return (ret);
16661663
}
16671664

1668-
void *failed_decrypt_buf;
1669-
int faile_decrypt_size;
1670-
16711665
/*
16721666
* Primary encryption / decryption entrypoint for zio data.
16731667
*/
@@ -1760,13 +1754,6 @@ zio_do_crypt_data(boolean_t encrypt, zio_crypt_key_t *key,
17601754
return (0);
17611755

17621756
error:
1763-
if (!encrypt) {
1764-
if (failed_decrypt_buf != NULL)
1765-
kmem_free(failed_decrypt_buf, failed_decrypt_size);
1766-
failed_decrypt_buf = kmem_alloc(datalen, KM_SLEEP);
1767-
failed_decrypt_size = datalen;
1768-
memcpy(failed_decrypt_buf, cipherbuf, datalen);
1769-
}
17701757
if (locked)
17711758
rw_exit(&key->zk_salt_lock);
17721759
if (authbuf != NULL)

0 commit comments

Comments
 (0)