dm btree: add a defensive bounds check to insert_at()
authorJoe Thornber <ejt@redhat.com>
Fri, 10 Dec 2021 13:44:13 +0000 (13:44 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 07:47:38 +0000 (08:47 +0100)
commit4ced798df50eec17a7c42c3f0700b7307038e383
treeb7fc9d7c251697dba26bce1c9a7ce98fd6e6bbde
parent3105f92cec9e57a0b0ba9b007108eac2c09f3626
dm btree: add a defensive bounds check to insert_at()

[ Upstream commit 85bca3c05b6cca31625437eedf2060e846c4bbad ]

Corrupt metadata could trigger an out of bounds write.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/persistent-data/dm-btree.c