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 09:41:03 -08:00
2021-02-24 10:25:37 -08:00
2021-02-22 14:44:39 -08:00
2021-02-23 15:05:10 -08:00
2021-02-22 10:05:12 -08:00
2021-02-22 14:27:07 -08:00
2021-02-22 09:52:55 -08:00
2021-02-28 15:48:25 -08:00
2021-03-13 12:38:44 -08:00
2021-02-24 10:25:37 -08:00
2021-02-24 09:35:54 -08:00
2021-02-24 10:25:37 -08:00
2021-03-21 10:57:35 -07:00
2021-02-25 12:23:49 -08:00
2021-03-20 10:57:10 -07:00
2021-02-26 14:16:06 -08:00
2021-02-28 11:51:20 -08:00
2021-03-18 11:20:35 -07:00
2021-03-18 11:20:35 -07:00
2021-02-09 12:15:07 +01:00
2021-03-12 11:34:36 -08:00