Mikulas Patocka 4edbe1d7bc dm ioctl: fix out of bounds array access when no devices
If there are not any dm devices, we need to zero the "dev" argument in
the first structure dm_name_list. However, this can cause out of
bounds write, because the "needed" variable is zero and len may be
less than eight.

Fix this bug by reporting DM_BUFFER_FULL_FLAG if the result buffer is
too small to hold the "nl->dev" value.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2021-03-26 14:51:50 -04:00
..
2021-02-26 15:49:51 -07:00
2021-02-26 15:49:51 -07:00
2020-07-08 17:20:46 -06:00
2021-02-03 10:13:00 -05:00
2020-12-16 13:09:32 -08:00
2021-02-01 09:35:20 -07:00
2021-01-27 09:51:48 -07:00
2020-12-16 12:57:51 -08:00
2021-01-27 09:51:48 -07:00
2021-02-21 11:06:54 -08:00