HomeFreeBSD

Preserve itx alloc size for zio_data_buf_free()

Description

Preserve itx alloc size for zio_data_buf_free()

Using zio_data_buf_alloc() to allocate the itx's may be unsafe
because the itx->itx_lr.lrc_reclen field is not constant from
allocation to free. Using a different itx->itx_lr.lrc_reclen
size in zio_data_buf_free() can result in the allocation being
returned to the wrong kmem cache.

This issue can be avoided entirely by storing the allocation size
in itx->itx_size and using that for zio_data_buf_free().

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6912

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Dec 4 2017, 7:44 PM
GitHub <noreply@github.com>Committed on Dec 4 2017, 7:44 PM
Parents
rGd4677269f286: Unbreak the scan status ABI
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG72841b9fd957: Preserve itx alloc size for zio_data_buf_free() (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Dec 4 2017, 7:44 PM