]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: Fix static analysis bug in validate_bksv
authorBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Wed, 6 Nov 2019 19:58:45 +0000 (14:58 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Nov 2019 15:12:54 +0000 (10:12 -0500)
commit92a39ef95215d982c20867f9784833f5cfda3e31
tree26551227a2edc1e425f6d429e60ad507ce55a1d4
parentd0690f1132dd952253a00efad41c214e8c7b3e95
drm/amd/display: Fix static analysis bug in validate_bksv

[Why]
static analysis throws the error below

Out-of-bounds read (OVERRUN)
Overrunning array of 5 bytes at byte offset 7 by dereferencing pointer
(uint64_t *)hdcp->auth.msg.hdcp1.bksv.

var n is going to contain  r0p and bcaps. if they are non-zero the count
will be wrong

How]
Use memcpy instead to avoid this.

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/modules/hdcp/hdcp1_execution.c