]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm init: Handle minors larger than 255
authorBenjamin Marzinski <bmarzins@redhat.com>
Tue, 2 Jul 2024 10:13:24 +0000 (12:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:07:47 +0000 (11:07 +0200)
commit8ab1d1fed7f00c53f677474bb3ac21e8ac823c10
tree9cf2b7987c52b3fccef1c46a2f149a9275095f70
parent2aa4bacbff442d6a44a6980490bfa2a283dc92d0
dm init: Handle minors larger than 255

[ Upstream commit 140ce37fd78a629105377e17842465258a5459ef ]

dm_parse_device_entry() simply copies the minor number into dmi.dev, but
the dev_t format splits the minor number between the lowest 8 bytes and
highest 12 bytes. If the minor number is larger than 255, part of it
will end up getting treated as the major number

Fix this by checking that the minor number is valid and then encoding it
as a dev_t.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/dm-init.c