• Thierry Reding's avatar
    drm/tegra: Don't leak kernel pointer to userspace · bdd2f9cd
    Thierry Reding authored
    Each open file descriptor can have any number of contexts associated
    with it. To differentiate between these contexts a unique ID is required
    and back when these userspace interfaces were introduced, in commit
    d43f81cb ("drm/tegra: Add gr2d device"), the pointer to the context
    structure was deemed adequate. However, this leaks information about
    kernel internal memory to userspace, which can potentially be exploited.
    
    Switch the context parameter to be allocated from an IDR, which has the
    added benefit of providing an easy way to look up a context from its ID.
    Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
    bdd2f9cd
drm.c 26.7 KB