• Jon Bloomfield's avatar
    UBUNTU: SAUCE: i915_bpo: drm/i915: Support ro ppgtt mapped cmdparser shadow buffers · 5925f447
    Jon Bloomfield authored
    For Gen7, the original cmdparser motive was to permit limited
    use of register read/write instructions in unprivileged BB's.
    This worked by copying the user supplied bb to a kmd owned
    bb, and running it in secure mode, from the ggtt, only if
    the scanner finds no unsafe commands or registers.
    
    For Gen8+ we can't use this same technique because running bb's
    from the ggtt also disables access to ppgtt space. But we also
    do not actually require 'secure' execution since we are only
    trying to reduce the available command/register set. Instead we
    will copy the user buffer to a kmd owned read-only bb in ppgtt,
    and run in the usual non-secure mode.
    
    Note that ro pages are only supported by ppgtt (not ggtt), but
    luckily that's exactly what we need.
    
    Add the required paths to map the shadow buffer to ppgtt ro for Gen8+
    Signed-off-by: default avatarJon Bloomfield <jon.bloomfield@intel.com>
    Cc: Joonas Lahtinen <joonas.lahtinen@intel.com>
    Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
    
    CVE-2019-0155
    
    [tjaalton: backport to i915_bpo
     - dev_priv doesn't have gtt, use ggtt instead]
    Signed-off-by: default avatarTimo Aaltonen <timo.aaltonen@canonical.com>
    Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
    5925f447
i915_drv.h 113 KB