mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
bcachefs: Fix stack oob in __bch2_encrypt_bio()
Reported-by: syzbot+fff6b0fb00259873576a@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
70dd062e27
commit
2ba24864d2
@ -352,8 +352,12 @@ int __bch2_encrypt_bio(struct bch_fs *c, unsigned type,
|
||||
bytes += bv.bv_len;
|
||||
}
|
||||
|
||||
sg_mark_end(sg - 1);
|
||||
return do_encrypt_sg(c->chacha20, nonce, sgl, bytes);
|
||||
if (sg != sgl) {
|
||||
sg_mark_end(sg - 1);
|
||||
return do_encrypt_sg(c->chacha20, nonce, sgl, bytes);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct bch_csum bch2_checksum_merge(unsigned type, struct bch_csum a,
|
||||
|
Loading…
Reference in New Issue
Block a user