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 08:00:57 +0000 (09:00 +0100)
commit74b16f895b47cce7b6a6d6830c8a41b51f3fa04f
treecad7f7d48879be2a8083ef27784388ed536401be
parenteafd73401a692744b342cbf0e77a3d7d640be687
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