1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/gpu/drm/nouveau/nvkm/subdev/acr
Zhou Qingyang 2343bcdb47 drm/nouveau/acr: Fix undefined behavior in nvkm_acr_hsfw_load_bl()
In nvkm_acr_hsfw_load_bl(), the return value of kmalloc() is directly
passed to memcpy(), which could lead to undefined behavior on failure
of kmalloc().

Fix this bug by using kmemdup() instead of kmalloc()+memcpy().

This bug was found by a static analyzer.

Builds with 'make allyesconfig' show no new warnings,
and our static analyzer no longer warns about this code.

Fixes: 22dcda45a3 ("drm/nouveau/acr: implement new subdev to replace "secure boot"")
Signed-off-by: Zhou Qingyang <zhou1615@umn.edu>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220124165856.57022-1-zhou1615@umn.edu
2022-01-25 17:50:49 -05:00
..
base.c drm/nouveau/acr: switch to instanced constructor 2021-02-11 11:49:52 +10:00
gm20b.c drm/nouveau/acr: switch to instanced constructor 2021-02-11 11:49:52 +10:00
gm200.c drm/nouveau/acr: fix a couple NULL vs IS_ERR() checks 2021-11-18 23:55:52 +01:00
gp10b.c drm/nouveau/acr: switch to instanced constructor 2021-02-11 11:49:52 +10:00
gp102.c drm/nouveau/acr: fix a couple NULL vs IS_ERR() checks 2021-11-18 23:55:52 +01:00
gp108.c drm/nouveau/acr: switch to instanced constructor 2021-02-11 11:49:52 +10:00
hsfw.c drm/nouveau/acr: Fix undefined behavior in nvkm_acr_hsfw_load_bl() 2022-01-25 17:50:49 -05:00
Kbuild
lsfw.c
priv.h drm/nouveau/acr: switch to instanced constructor 2021-02-11 11:49:52 +10:00
tu102.c drm/nouveau/acr: switch to instanced constructor 2021-02-11 11:49:52 +10:00