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 10:04:52 +0000 (11:04 +0100)
commitb5aee20b53163c9cfa810012ad073a25d96f6161
treed808b59796f0afc6043f3d52f31ccc5bf57e0cfb
parent3c3417b013cf1173d040f5225c918d7ebb4a6643
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