Jeremy Cline
eb8ca93e49
drm/amdkfd: Fix out-of-bounds read in kdf_create_vcrat_image_cpu()
...
[ Upstream commit 8b335bff643f3b39935c7377dbcd361c5b605d98 ]
KASAN reported a slab-out-of-bounds read of size 1 in
kdf_create_vcrat_image_cpu().
This occurs when, for example, when on an x86_64 with a single NUMA node
because kfd_fill_iolink_info_for_cpu() is a no-op, but afterwards the
sub_type_hdr->length, which is out-of-bounds, is read and multiplied by
entries. Fortunately, entries is 0 in this case so the overall
crat_table->length is still correct.
Check if there were any entries before de-referencing sub_type_hdr which
may be pointing to out-of-bounds memory.
Fixes: b7b6c38529
("drm/amdkfd: Calculate CPU VCRAT size dynamically (v2)")
Suggested-by: Felix Kuehling <Felix.Kuehling@amd.com >
Signed-off-by: Jeremy Cline <jcline@redhat.com >
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com >
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-01-27 11:55:08 +01:00
..
2021-01-27 11:55:08 +01:00
2020-06-10 09:02:03 +02:00
2020-09-08 14:41:40 +10:00
2020-09-23 09:52:24 +10:00
2020-12-30 11:52:56 +01:00
2020-11-25 09:13:20 +01:00
2020-07-02 20:25:51 +02:00
2020-08-11 11:58:31 +10:00
2021-01-19 18:27:19 +01:00
2020-09-23 09:52:24 +10:00
2020-11-23 10:01:32 +09:00
2020-09-08 14:41:40 +10:00
2020-12-30 11:52:55 +01:00
2020-08-30 20:35:55 -04:00
2020-08-06 14:27:31 -07:00
2020-09-11 10:54:17 +02:00
2021-01-27 11:54:56 +01:00
2020-12-30 11:53:22 +01:00
2020-10-12 20:26:14 +02:00
2020-09-10 08:18:35 +02:00
2020-12-30 11:52:56 +01:00
2020-12-30 11:53:24 +01:00
2020-12-30 11:53:18 +01:00
2020-08-27 11:17:52 +02:00
2021-01-19 18:27:27 +01:00
2020-12-30 11:53:53 +01:00
2021-01-27 11:55:03 +01:00
2020-12-30 11:53:13 +01:00
2021-01-23 16:04:04 +01:00
2021-01-17 14:17:06 +01:00
2020-07-23 10:06:22 +02:00
2020-09-18 06:14:41 +10:00
2020-04-03 17:11:41 +02:00
2020-10-12 10:40:43 +10:00
2020-09-23 08:19:29 +10:00
2020-11-29 17:33:32 +01:00
2020-08-23 17:36:59 -05:00
2020-09-15 17:52:42 -04:00
2020-09-01 13:02:33 +05:30
2020-06-10 09:05:18 +02:00
2020-09-08 14:41:40 +10:00
2020-07-08 11:47:01 +02:00
2020-11-19 09:26:07 +01:00
2020-11-26 18:44:48 +01:00
2020-08-21 15:17:05 +03:00
2020-08-23 17:36:59 -05:00
2020-06-24 09:17:34 +02:00
2020-10-21 06:59:07 +10:00
2020-12-30 11:52:56 +01:00
2020-12-30 11:53:09 +01:00
2020-10-26 11:43:31 +01:00
2020-09-14 09:12:24 +02:00
2020-11-23 17:59:30 +01:00
2020-09-11 10:47:19 +02:00
2020-08-23 17:36:59 -05:00
2020-09-23 09:52:24 +10:00
2020-09-11 10:47:19 +02:00
2020-10-17 11:18:18 -07:00
2020-09-23 09:52:24 +10:00
2020-09-14 18:11:40 +02:00
2020-08-06 14:27:31 -07:00
2021-01-27 11:54:55 +01:00
2020-07-02 20:25:51 +02:00
2020-07-02 15:26:00 +02:00
2020-07-02 15:26:00 +02:00
2020-06-15 14:49:50 +01:00
2020-05-14 02:10:52 +03:00
2020-08-26 19:11:41 +02:00
2020-06-23 19:53:27 +02:00
2020-08-23 17:36:59 -05:00
2020-09-10 08:17:48 +02:00
2020-05-27 14:31:42 +03:00
2020-05-26 13:31:01 +02:00
2020-08-17 13:41:50 -04:00
2020-09-01 13:38:34 +03:00
2020-03-16 09:23:55 +01:00
2020-07-13 13:29:20 -04:00
2020-07-02 15:26:00 +02:00
2020-03-18 17:53:28 +01:00
2020-08-25 11:00:02 +02:00
2020-09-01 09:45:44 +02:00
2020-06-25 15:47:14 -07:00
2020-04-03 17:11:41 +02:00
2020-12-30 11:54:19 +01:00
2020-10-27 11:20:36 +01:00
2020-09-23 09:52:24 +10:00
2020-09-21 10:45:08 +02:00
2020-12-30 11:54:29 +01:00
2020-06-19 09:20:21 +02:00
2020-04-21 08:15:03 +02:00
2020-10-02 14:56:06 +02:00
2020-07-02 15:26:00 +02:00
2020-05-26 13:33:08 +02:00
2020-06-19 13:33:40 +01:00
2020-09-09 11:45:18 +02:00
2020-09-10 08:17:48 +02:00
2020-05-19 22:31:31 +01:00
2020-10-28 12:27:41 +01:00
2020-09-08 10:43:30 +02:00
2020-11-20 05:20:48 +10:00
2020-10-28 12:27:41 +01:00
2020-05-05 14:01:53 -04:00
2020-09-21 10:45:08 +02:00
2020-07-02 15:26:00 +02:00
2020-06-24 15:45:51 +10:00
2020-05-29 12:58:11 +02:00
2020-07-02 15:26:00 +02:00
2020-07-02 15:26:00 +02:00
2020-09-21 10:45:08 +02:00
2020-08-11 11:58:31 +10:00
2020-07-10 20:21:45 +02:00
2020-06-23 15:46:40 +02:00
2020-07-02 15:26:00 +02:00
2020-08-17 13:41:50 -04:00
2020-08-23 17:36:59 -05:00
2020-08-11 11:58:31 +10:00
2020-08-04 11:45:23 +02:00
2020-08-16 17:12:18 +02:00
2020-07-02 15:26:00 +02:00
2020-08-25 11:00:02 +02:00
2020-10-27 11:21:04 +01:00
2020-07-31 14:42:37 +10:00
2020-06-02 10:59:11 -07:00
2020-03-06 09:24:29 +01:00
2021-01-27 11:54:55 +01:00
2020-06-03 10:24:23 +02:00
2020-08-06 11:55:43 -07:00
2020-09-14 22:37:31 +03:00
2020-06-24 15:45:51 +10:00
2020-05-20 20:03:45 +02:00
2020-07-18 02:59:16 +03:00
2020-09-09 16:39:48 +02:00