1. 24 3月, 2021 1 次提交
  2. 12 3月, 2021 1 次提交
  3. 20 1月, 2021 1 次提交
  4. 05 1月, 2021 1 次提交
  5. 24 12月, 2020 1 次提交
  6. 16 12月, 2020 1 次提交
  7. 06 10月, 2020 1 次提交
  8. 01 10月, 2020 1 次提交
  9. 29 9月, 2020 1 次提交
  10. 25 8月, 2020 1 次提交
  11. 21 8月, 2020 1 次提交
  12. 02 6月, 2020 2 次提交
  13. 04 2月, 2020 1 次提交
  14. 17 12月, 2019 1 次提交
  15. 12 12月, 2019 6 次提交
  16. 05 12月, 2019 1 次提交
  17. 28 11月, 2019 1 次提交
  18. 12 11月, 2019 1 次提交
    • B
      drm/i915/cmdparser: Fix jump whitelist clearing · ea0b163b
      Ben Hutchings 提交于
      When a jump_whitelist bitmap is reused, it needs to be cleared.
      Currently this is done with memset() and the size calculation assumes
      bitmaps are made of 32-bit words, not longs.  So on 64-bit
      architectures, only the first half of the bitmap is cleared.
      
      If some whitelist bits are carried over between successive batches
      submitted on the same context, this will presumably allow embedding
      the rogue instructions that we're trying to reject.
      
      Use bitmap_zero() instead, which gets the calculation right.
      
      Fixes: f8c08d8f ("drm/i915/cmdparser: Add support for backward jumps")
      Signed-off-by: NBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      ea0b163b
  19. 06 11月, 2019 7 次提交
    • J
      drm/i915/cmdparser: Ignore Length operands during command matching · 926abff2
      Jon Bloomfield 提交于
      Some of the gen instruction macros (e.g. MI_DISPLAY_FLIP) have the
      length directly encoded in them. Since these are used directly in
      the tables, the Length becomes part of the comparison used for
      matching during parsing. Thus, if the cmd being parsed has a
      different length to that in the table, it is not matched and the
      cmd is accepted via the default variable length path.
      
      Fix by masking out everything except the Opcode in the cmd tables
      
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Tyler Hicks <tyhicks@canonical.com>
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      926abff2
    • J
      drm/i915/cmdparser: Add support for backward jumps · f8c08d8f
      Jon Bloomfield 提交于
      To keep things manageable, the pre-gen9 cmdparser does not
      attempt to track any form of nested BB_START's. This did not
      prevent usermode from using nested starts, or even chained
      batches because the cmdparser is not strictly enforced pre gen9.
      
      Instead, the existence of a nested BB_START would cause the batch
      to be emitted in insecure mode, and any privileged capabilities
      would not be available.
      
      For Gen9, the cmdparser becomes mandatory (for BCS at least), and
      so not providing any form of nested BB_START support becomes
      overly restrictive. Any such batch will simply not run.
      
      We make heavy use of backward jumps in igt, and it is much easier
      to add support for this restricted subset of nested jumps, than to
      rewrite the whole of our test suite to avoid them.
      
      Add the required logic to support limited backward jumps, to
      instructions that have already been validated by the parser.
      
      Note that it's not sufficient to simply approve any BB_START
      that jumps backwards in the buffer because this would allow an
      attacker to embed a rogue instruction sequence within the
      operand words of a harmless instruction (say LRI) and jump to
      that.
      
      We introduce a bit array to track every instr offset successfully
      validated, and test the target of BB_START against this. If the
      target offset hits, it is re-written to the same offset in the
      shadow buffer and the BB_START cmd is allowed.
      
      Note: This patch deliberately ignores checkpatch issues in the
      cmdtables, in order to match the style of the surrounding code.
      We'll correct the entire file in one go in a later patch.
      
      v2: set dispatch secure late (Mika)
      v3: rebase (Mika)
      v4: Clear whitelist on each parse
          Minor review updates (Chris)
      v5: Correct backward jump batching
      v6: fix compilation error due to struct eb shuffle (Mika)
      
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Tyler Hicks <tyhicks@canonical.com>
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      Signed-off-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      f8c08d8f
    • J
      drm/i915/cmdparser: Use explicit goto for error paths · 0546a29c
      Jon Bloomfield 提交于
      In the next patch we will be adding a second valid
      termination condition which will require a small
      amount of refactoring to share logic with the BB_END
      case.
      
      Refactor all error conditions to jump to a dedicated
      exit path, with 'break' reserved only for a successful
      parse.
      
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Tyler Hicks <tyhicks@canonical.com>
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      0546a29c
    • J
      drm/i915: Add gen9 BCS cmdparsing · 0f2f3975
      Jon Bloomfield 提交于
      For gen9 we enable cmdparsing on the BCS ring, specifically
      to catch inadvertent accesses to sensitive registers
      
      Unlike gen7/hsw, we use the parser only to block certain
      registers. We can rely on h/w to block restricted commands,
      so the command tables only provide enough info to allow the
      parser to delineate each command, and identify commands that
      access registers.
      
      Note: This patch deliberately ignores checkpatch issues in
      favour of matching the style of the surrounding code. We'll
      correct the entire file in one go in a later patch.
      
      v3: rebase (Mika)
      v4: Add RING_TIMESTAMP registers to whitelist (Jon)
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Tyler Hicks <tyhicks@canonical.com>
      Signed-off-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      0f2f3975
    • J
      drm/i915: Add support for mandatory cmdparsing · 311a50e7
      Jon Bloomfield 提交于
      The existing cmdparser for gen7 can be bypassed by specifying
      batch_len=0 in the execbuf call. This is safe because bypassing
      simply reduces the cmd-set available.
      
      In a later patch we will introduce cmdparsing for gen9, as a
      security measure, which must be strictly enforced since without
      it we are vulnerable to DoS attacks.
      
      Introduce the concept of 'required' cmd parsing that cannot be
      bypassed by submitting zero-length bb's.
      
      v2: rebase (Mika)
      v2: rebase (Mika)
      v3: fix conflict on engine flags (Mika)
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Tyler Hicks <tyhicks@canonical.com>
      Signed-off-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      311a50e7
    • J
      drm/i915: Remove Master tables from cmdparser · 66d8aba1
      Jon Bloomfield 提交于
      The previous patch has killed support for secure batches
      on gen6+, and hence the cmdparsers master tables are
      now dead code. Remove them.
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Tyler Hicks <tyhicks@canonical.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      66d8aba1
    • J
      drm/i915: Rename gen7 cmdparser tables · 0a2f661b
      Jon Bloomfield 提交于
      We're about to introduce some new tables for later gens, and the
      current naming for the gen7 tables will no longer make sense.
      
      v2: rebase
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Tyler Hicks <tyhicks@canonical.com>
      Signed-off-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris.p.wilson@intel.com>
      0a2f661b
  20. 09 8月, 2019 1 次提交
  21. 06 8月, 2019 1 次提交
  22. 28 5月, 2019 2 次提交
  23. 25 4月, 2019 1 次提交
  24. 06 3月, 2019 1 次提交
  25. 13 12月, 2018 1 次提交
  26. 07 2月, 2018 2 次提交