Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 3df929b0 authored by Ziqi Zhao's avatar Ziqi Zhao Committed by Greg Kroah-Hartman
Browse files

drm/crtc: Fix uninit-value bug in drm_mode_setcrtc



[ Upstream commit 3823119b9c2b5f9e9b760336f75bc989b805cde6 ]

The connector_set contains uninitialized values when allocated with
kmalloc_array. However, in the "out" branch, the logic assumes that any
element in connector_set would be equal to NULL if failed to
initialize, which causes the bug reported by Syzbot. The fix is to use
an extra variable to keep track of how many connectors are initialized
indeed, and use that variable to decrease any refcounts in the "out"
branch.

Reported-by: default avatar <syzbot+4fad2e57beb6397ab2fc@syzkaller.appspotmail.com>
Signed-off-by: default avatarZiqi Zhao <astrajoan@yahoo.com>
Reported-and-tested-by: default avatar <syzbot+4fad2e57beb6397ab2fc@syzkaller.appspotmail.com>
Tested-by: default avatarHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Link: https://lore.kernel.org/r/20230721161446.8602-1-astrajoan@yahoo.com


Signed-off-by: default avatarMaxime Ripard <mripard@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 15741916
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment