Commit 442e3c0a authored by Jeremy Cline's avatar Jeremy Cline Committed by Zheng Zengkai
Browse files

drm/nouveau: Add a dedicated mutex for the clients list

mainline inclusion
from mainline
commit abae9164
bugzilla: 185776 https://gitee.com/openeuler/kernel/issues/I4DDEL
CVE: CVE-2020-27820

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=abae9164a421bc4a41a3769f01ebcd1f9d955e0e



--------------------------------

Rather than protecting the nouveau_drm clients list with the lock within
the "client" nouveau_cli, add a dedicated lock to serialize access to
the list. This is both clearer and necessary to avoid lockdep being
upset with us when we need to iterate through all the clients in the
list and potentially lock their mutex, which is the same class as the
lock protecting the entire list.

Cc: stable@vger.kernel.org # 5.4+
Signed-off-by: default avatarJeremy Cline <jcline@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
Reviewed-by: default avatarBen Skeggs <bskeggs@redhat.com>
Tested-by: default avatarKarol Herbst <kherbst@redhat.com>
Signed-off-by: default avatarKarol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201125202648.5220-3-jcline@redhat.com
Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/14


Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Reviewed-by: default avatarweiyang wang <wangweiyang2@huawei.com>
Reviewed-by: default avatarJason Yan <yanaijie@huawei.com>

Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent c0d93f31
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment