module: zfs: zio_inject: zio_match_handler: don't << -1

Caught by UBSAN: ZI_NO_DVA is passed explicitly in
zio_handle_decrypt_injection() and can be an ENOENT from zio_match_dva()

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13146
Closes #13190
This commit is contained in:
наб 2022-03-13 21:18:17 +01:00 committed by GitHub
parent 56a0699e5e
commit dad2b19fff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -148,7 +148,8 @@ zio_match_handler(const zbookmark_phys_t *zb, uint64_t type, int dva,
zb->zb_level == record->zi_level && zb->zb_level == record->zi_level &&
zb->zb_blkid >= record->zi_start && zb->zb_blkid >= record->zi_start &&
zb->zb_blkid <= record->zi_end && zb->zb_blkid <= record->zi_end &&
(record->zi_dvas == 0 || (record->zi_dvas & (1ULL << dva))) && (record->zi_dvas == 0 ||
(dva != ZI_NO_DVA && (record->zi_dvas & (1ULL << dva)))) &&
error == record->zi_error) { error == record->zi_error) {
return (freq_triggered(record->zi_freq)); return (freq_triggered(record->zi_freq));
} }