Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zfs: Overallocate nvpair buffers on all CHERI platforms
Otherwise the size != NV_ALIGN(size2) check in i_validate_nvpair() can fail for nvlists created by a purecap userspace when consumed by a hybrid kernel. This arises for me with nextboot, which uses zfsbootcfg under the hood to invoke ZFS_IOC_{GET,SET}_BOOTENV. For a freshly created pool, the boot environment type will be VB_RAW, and gets converted to a VB_NVLIST upon the first write. After that, it is re-read from the pool by the kernel and allocated without the extra space allocated by the NVPAIR_OVER_ALLOCATE_DECODE option. When zfsbootcfg subsequently modifies and sets the boot environment again, the nvlist contains pad bytes inserted by nvpair_nominal_decode_size(), and the above-mentioned check in i_validate_nvpair() fails.
- Loading branch information