Denis Efremov
ddd64dd895
floppy: fix out-of-bounds read in copy_buffer
...
[ Upstream commit da99466ac2 ]
This fixes a global out-of-bounds read access in the copy_buffer
function of the floppy driver.
The FDDEFPRM ioctl allows one to set the geometry of a disk. The sect
and head fields (unsigned int) of the floppy_drive structure are used to
compute the max_sector (int) in the make_raw_rw_request function. It is
possible to overflow the max_sector. Next, max_sector is passed to the
copy_buffer function and used in one of the memcpy calls.
An unprivileged user could trigger the bug if the device is accessible,
but requires a floppy disk to be inserted.
The patch adds the check for the .sect * .head multiplication for not
overflowing in the set_geometry function.
The bug was found by syzkaller.
Signed-off-by: Denis Efremov <efremov@ispras.ru >
Tested-by: Willy Tarreau <w@1wt.eu >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-05-15 14:02:36 +09:00
..
2023-05-15 12:46:28 +09:00
2018-05-01 15:13:08 -07:00
2023-05-12 16:27:16 +09:00
2020-02-04 13:48:58 +09:00
2023-05-15 14:01:13 +09:00
2023-05-15 11:44:23 +09:00
2018-02-13 12:35:55 +01:00
2023-05-15 14:00:40 +09:00
2023-05-15 14:02:36 +09:00
2023-05-15 14:01:33 +09:00
2023-05-15 10:05:32 +09:00
2023-05-15 12:17:16 +09:00
2023-05-15 13:36:01 +09:00
2023-05-15 13:57:04 +09:00
2023-05-15 14:01:14 +09:00
2023-05-15 13:35:19 +09:00
2023-05-15 11:22:49 +09:00
2023-05-15 14:01:54 +09:00
2018-02-28 10:18:33 +01:00
2018-04-13 19:48:09 +02:00
2023-05-15 13:59:26 +09:00
2020-02-04 13:48:58 +09:00
2023-05-15 14:01:26 +09:00
2023-05-15 13:35:13 +09:00
2018-05-30 07:50:18 +02:00
2023-05-15 13:40:43 +09:00
2023-05-15 14:01:32 +09:00
2023-05-15 14:02:17 +09:00
2022-03-15 09:20:56 +09:00
2023-05-15 13:35:51 +09:00
2018-03-24 11:00:12 +01:00
2023-05-15 10:45:29 +09:00
2023-05-15 13:55:14 +09:00
2023-05-15 12:52:30 +09:00
2023-05-15 13:49:54 +09:00
2023-05-15 10:39:04 +09:00
2023-05-15 12:46:28 +09:00
2023-05-15 13:35:27 +09:00
2023-05-15 14:00:51 +09:00
2023-05-15 14:01:56 +09:00
2023-05-15 13:47:46 +09:00
2023-05-15 13:41:02 +09:00
2023-05-15 13:49:45 +09:00
2023-05-15 12:37:28 +09:00
2023-05-15 09:10:25 +09:00
2023-05-12 17:22:44 +09:00
2017-09-09 17:39:41 +02:00
2023-05-15 14:01:27 +09:00
2023-05-15 14:02:11 +09:00
2023-05-15 12:52:51 +09:00
2023-05-15 11:22:55 +09:00
2018-05-25 17:06:35 +02:00
2023-05-15 13:56:57 +09:00
2023-05-15 13:58:47 +09:00
2023-05-15 13:35:09 +09:00
2023-05-15 11:30:03 +09:00
2023-05-15 14:02:00 +09:00
2023-05-15 12:50:06 +09:00
2018-05-30 07:50:22 +02:00
2023-05-15 14:02:25 +09:00
2023-05-15 13:55:16 +09:00
2023-05-15 13:47:50 +09:00
2023-05-15 09:58:01 +09:00
2023-05-15 13:40:57 +09:00
2023-05-15 13:54:47 +09:00
2023-05-15 14:02:22 +09:00
2023-05-15 09:18:55 +09:00
2020-02-04 13:48:58 +09:00
2023-05-15 11:45:19 +09:00
2023-05-15 13:34:23 +09:00
2023-05-15 13:48:11 +09:00
2023-05-15 12:53:32 +09:00
2023-05-15 12:46:28 +09:00
2023-05-15 11:22:20 +09:00
2023-05-15 13:48:28 +09:00
2023-05-15 13:47:01 +09:00
2023-05-15 14:01:57 +09:00
2023-05-15 10:06:13 +09:00
2023-05-15 09:23:11 +09:00
2023-05-15 13:49:26 +09:00
2023-05-15 14:00:32 +09:00
2023-05-15 10:37:00 +09:00
2023-05-15 14:01:47 +09:00
2023-05-15 13:48:00 +09:00
2023-05-15 13:56:40 +09:00
2017-07-27 15:08:08 -07:00
2023-05-15 12:59:29 +09:00
2023-05-15 13:59:54 +09:00
2023-05-15 12:05:59 +09:00
2023-05-15 09:23:01 +09:00
2020-02-04 13:48:58 +09:00
2023-05-15 13:47:20 +09:00
2018-04-24 09:34:12 +02:00
2023-05-15 13:58:38 +09:00
2023-05-15 09:51:46 +09:00
2023-05-15 13:58:42 +09:00
2023-05-15 08:28:33 +09:00
2023-05-15 12:38:46 +09:00
2023-05-15 14:00:50 +09:00
2023-05-15 13:48:17 +09:00
2023-05-15 12:50:46 +09:00
2023-05-15 12:22:45 +09:00
2023-05-15 13:00:07 +09:00
2023-05-15 13:47:45 +09:00
2023-05-15 14:01:42 +09:00
2018-05-30 07:50:44 +02:00
2019-12-11 18:21:09 +09:00
2019-12-11 18:21:09 +09:00