]> git.baikalelectronics.ru Git - kernel.git/commit
nouveau/svm: Use struct_size() helper in nouveau_pfns_map()
authorGustavo A. R. Silva <gustavoars@kernel.org>
Mon, 7 Feb 2022 23:39:23 +0000 (17:39 -0600)
committerLyude Paul <lyude@redhat.com>
Tue, 8 Feb 2022 20:11:22 +0000 (15:11 -0500)
commit50acdaf1285e26d27a1e8bbc453c37b16d630d8d
treedfe1d7a6e40b1935101e8e468aa5b74317e53b21
parent914e1605df2f4945cb7067981d641069a8bafb18
nouveau/svm: Use struct_size() helper in nouveau_pfns_map()

Make use of the struct_size() helper instead of an open-coded version,
in order to avoid any potential type mistakes or integer overflows that,
in the worse scenario, could lead to heap overflows.

Link: https://github.com/KSPP/linux/issues/160
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220207233923.GA524723@embeddedor
drivers/gpu/drm/nouveau/nouveau_svm.c