Commit 2ba24864 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: Fix stack oob in __bch2_encrypt_bio()

parent 70dd062e
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -352,10 +352,14 @@ int __bch2_encrypt_bio(struct bch_fs *c, unsigned type,
		bytes += bv.bv_len;
	}

	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,
				    struct bch_csum b, size_t b_len)
{