1. 12 5月, 2016 18 次提交
    • E
      qmp: Tighten output visitor rules · 56a6f02b
      Eric Blake 提交于
      Tighten assertions in the QMP output visitor, so that:
      
      - qmp_output_get_qobject() can only be called after pairing a
      visit_end_* for every visit_start_* (rather than allowing it on
      a partially built object)
      
      - qmp_output_get_qobject() cannot be called unless at least one
      visit_type_* or visit_start/visit_end pair has occurred since
      creation/reset (the accidental return of NULL fixed by commit
      ab8bf1d7 would have been much easier to diagnose)
      
      - ensure that we are encountering the expected object or list
      type, to provide protection against mismatched push(struct)/
      pop(list) or push(list)/pop(struct), similar to the qmp-input
      protection added in commit bdd8e6b5.
      
      - ensure that except for the root, 'name' is non-null inside a
      dict, and NULL inside a list (this may need changing later if
      we add "name.0" support for better error messages for a list,
      but for now it makes sure all users are at least consistent)
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-19-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      56a6f02b
    • E
      qmp: Don't reuse qmp visitor after grabbing output · f2ff429b
      Eric Blake 提交于
      The testsuite was the only client that attempted to reuse a
      QmpOutputVisitor for a second visit after encountering an
      error and/or calling qmp_output_get_qobject() on a first
      visit.  The next patch is about to tighten the semantics to
      be one-shot usage of the visitor, like all other visitors
      (which will enable further simplifications down the road).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1462854006-24658-1-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      f2ff429b
    • E
      spapr_drc: Expose 'null' in qom-get when there is no fdt · a543a554
      Eric Blake 提交于
      Now that the QMP output visitor supports an explicit null
      output, we should utilize it to make it easier to diagnose
      the difference between a missing fdt ('null') vs. a
      present-but-empty one ('{}').
      
      (Note that this reverts the behavior of commit ab8bf1d7, taking
      us back to the behavior of commit 6c2f9a15 [which in turn
      stemmed from a crash fix in 1d10b445]; but that this time,
      the change is intentional and not an accidental side-effect.)
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Acked-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Message-Id: <1461879932-9020-17-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      a543a554
    • E
      qmp: Support explicit null during visits · 3df016f1
      Eric Blake 提交于
      Implement the new type_null() callback for the qmp input and
      output visitors. While we don't yet have a use for this in QAPI
      input (the generator will need some tweaks first), some
      potential usages have already been discussed on the list.
      Meanwhile, the output visitor could already output explicit null
      via type_any, but this gives us finer control.
      
      At any rate, it's easy to test that we can round-trip an explicit
      null through manual use of visit_type_null() wrapped by a virtual
      visit_start_struct() walk, even if we can't do the visit in a
      QAPI type.  Repurpose the test_visitor_out_empty test,
      particularly since a future patch will tighten semantics to
      forbid use of qmp_output_get_qobject() without at least one
      intervening visit_type_*.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-16-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      3df016f1
    • E
      qapi: Add visit_type_null() visitor · 3bc97fd5
      Eric Blake 提交于
      Right now, qmp-output-visitor happens to produce a QNull result
      if nothing is actually visited between the creation of the visitor
      and the request for the resulting QObject.  A stronger protocol
      would require that a QMP output visit MUST visit something.  But
      to still be able to produce a JSON 'null' output, we need a new
      visitor function that states our intentions.  Yes, we could say
      that such a visit must go through visit_type_any(), but that
      feels clunky.
      
      So this patch introduces the new visit_type_null() interface and
      its no-op interface in the dealloc visitor, and stubs in the
      qmp visitors (the next patch will finish the implementation).
      For the visitors that will not implement the callback, document
      the situation. The code in qapi-visit-core unconditionally
      dereferences the callback pointer, so that a segfault will inform
      a developer if they need to implement the callback for their
      choice of visitor.
      
      Note that JSON has a primitive null type, with the single value
      null; likewise with the QNull type for QObject; but for QAPI,
      we just have the 'null' value without a null type.  We may
      eventually want to add more support in QAPI for null (most likely,
      we'd use it via an alternate type that permits 'null' or an
      object); but we'll create that usage when we need it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-15-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      3bc97fd5
    • E
      tests: Add check-qnull · 7d7a337e
      Eric Blake 提交于
      Add a new test, for checking reference counting of qnull(). As
      part of the new file, move a previous reference counting change
      added in commit a8615640 to a more logical place.
      
      Note that while most of the check-q*.c leave visitor stuff to
      the test-qmp-*-visitor.c, in this case we actually want the
      visitor tests in our new file because we are validating the
      reference count of qnull_, which is an internal detail that
      test-qmp-*-visitor should not be peeking into (or put another
      way, qnull() is the only special case where we don't have
      independent allocation of a QObject, so none of the other
      visitor tests require the layering violation present in this
      test).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-14-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      7d7a337e
    • E
      qapi: Document visitor interfaces, add assertions · adfb264c
      Eric Blake 提交于
      The visitor interface for mapping between QObject/QemuOpts/string
      and QAPI is scandalously under-documented, making changes to visitor
      core, individual visitors, and users of visitors difficult to
      coordinate.  Among other questions: when is it safe to pass NULL,
      vs. when a string must be provided; which visitors implement which
      callbacks; the difference between concrete and virtual visits.
      
      Correct this by retrofitting proper contracts, and document where some
      of the interface warts remain (for example, we may want to modify
      visit_end_* to require the same 'obj' as the visit_start counterpart,
      so the dealloc visitor can be simplified).  Later patches in this
      series will tackle some, but not all, of these warts.
      
      Add assertions to (partially) enforce the contract.  Some of these
      were only made possible by recent cleanup commits.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-13-git-send-email-eblake@redhat.com>
      [Doc fix from Eric squashed in]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      adfb264c
    • E
      qmp-input: Refactor when list is advanced · fcf3cb21
      Eric Blake 提交于
      In the QMP input visitor, visiting a list traverses two objects:
      the QAPI GenericList of the caller (which gets advanced in
      visit_next_list() regardless of this patch), and the QList input
      that we are converting to QAPI.  For consistency with QDict
      visits, we want to consume elements from the input QList during
      the visit_type_FOO() for the list element; that is, we want ALL
      the code for consuming an input to live in qmp_input_get_object(),
      rather than having it split according to whether we are visiting
      a dict or a list.  Making qmp_input_get_object() the common point
      of consumption will make it easier for a later patch to refactor
      visit_start_list() to cover the GenericList * head of a QAPI list,
      and in turn will get rid of the 'first' flag (which lived in
      qmp_input_next_list() pre-patch, and is hoisted to StackObject
      by this patch).
      
      This patch is therefore altering the post-condition use of 'entry',
      while keeping what gets visited unchanged, from:
      
              start_list next_list type_ELT ... next_list type_ELT next_list end_list
       visits                      1st elt                last elt
       entry  NULL       1st elt   1st elt      last elt  last elt NULL      gone
      
      where type_ELT() returns (entry ? entry : 1st elt) and next_list() steps
      entry
      
      to this usage:
      
              start_list next_list type_ELT ... next_list type_ELT next_list end_list
       visits                      1st elt                last elt
       entry  1st elt    1nd elt   2nd elt      last elt  NULL     NULL      gone
      
      where type_ELT() steps entry and returns the old entry, and next_list()
      leaves entry alone.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-12-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      fcf3cb21
    • E
      qmp-input: Require struct push to visit members of top dict · ce140b17
      Eric Blake 提交于
      Don't embed the root of the visit into the stack of current
      containers being visited.  That way, we no longer get confused
      on whether the first visit of a dictionary is to the dictionary
      itself or to one of the members of the dictionary, based on
      whether the caller passed name=NULL; and makes the QMP Input
      visitor like other visitors where the value of 'name' is now
      ignored on the root visit.  (We may someday want to revisit
      the rules on what 'name' should be on a top-level visit,
      rather than just ignoring it; but that would be the topic of
      another patch).
      
      An audit of all qmp_input_visitor_new() call sites shows that
      there were only two places where callers had previously been
      visiting to a QDict with a non-NULL name to bypass a call to
      visit_start_struct(), and those were fixed in prior patches.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-11-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      ce140b17
    • E
      qom: Wrap prop visit in visit_start_struct · ad739706
      Eric Blake 提交于
      The qmp-input visitor was allowing callers to play rather fast
      and loose: when visiting a QDict, you could grab members of the
      root dictionary without first pushing into the dict; the final
      such culprit was the QOM code for converting to and from object
      properties.  But we are about to tighten the input visitor, at
      which point user_creatable_add_type() as called with a QMP input
      visitor via qmp_object_add() MUST follow the same paradigms as
      everyone else, of pushing into the struct before grabbing its
      keys.
      
      The use of 'err ? NULL : &err' is temporary; a later patch will
      clean that up when it splits visit_end_struct().
      
      Furthermore, note that both callers always pass qdict, so we can
      convert the conditional into an assert and reduce indentation.
      
      The change has no impact to the testsuite now, but is required to
      avoid a failure in tests/test-netfilter once qmp-input is made
      stricter to detect inconsistent 'name' arguments on the root visit.
      
      Since user_creatable_add_type() is also called with OptsVisitor
      through user_creatable_add_opts(), we must also check that there
      is no negative impact there; both pre- and post-patch, we see:
      
      $ ./x86_64-softmmu/qemu-system-x86_64 -nographic -nodefaults -qmp stdio -object secret,id=sec0,data=letmein,format=raw,foo=bar
      qemu-system-x86_64: -object secret,id=sec0,data=letmein,format=raw,foo=bar: Property '.foo' not found
      
      That is, the only new checking that the new visit_end_struct() can
      perform is for excess input, but we already catch excess input
      earlier in object_property_set().
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-10-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      ad739706
    • E
      qapi-commands: Wrap argument visit in visit_start_struct · ed841535
      Eric Blake 提交于
      The qmp-input visitor was allowing callers to play rather fast
      and loose: when visiting a QDict, you could grab members of the
      root dictionary without first pushing into the dict; among the
      culprit callers was the generated marshal code on the 'arguments'
      dictionary of a QMP command.  But we are about to tighten the
      input visitor, at which point the generated marshal code MUST
      follow the same paradigms as everyone else, of pushing into the
      struct before grabbing its keys.
      
      Generated code grows as follows:
      
      |@@ -515,7 +641,12 @@ void qmp_marshal_blockdev_backup(QDict *
      |     BlockdevBackup arg = {0};
      |
      |     v = qmp_input_get_visitor(qiv);
      |+    visit_start_struct(v, NULL, NULL, 0, &err);
      |+    if (err) {
      |+        goto out;
      |+    }
      |     visit_type_BlockdevBackup_members(v, &arg, &err);
      |+    visit_end_struct(v, err ? NULL : &err);
      |     if (err) {
      |         goto out;
      |     }
      |@@ -527,7 +715,9 @@ out:
      |     qmp_input_visitor_cleanup(qiv);
      |     qdv = qapi_dealloc_visitor_new();
      |     v = qapi_dealloc_get_visitor(qdv);
      |+    visit_start_struct(v, NULL, NULL, 0, NULL);
      |     visit_type_BlockdevBackup_members(v, &arg, NULL);
      |+    visit_end_struct(v, NULL);
      |     qapi_dealloc_visitor_cleanup(qdv);
      | }
      
      The use of 'err ? NULL : &err' is temporary; a later patch will
      clean that up when it splits visit_end_struct().
      
      Prior to this patch, the fact that there was no final
      visit_end_struct() meant that even though we are using a strict
      input visit, the marshalling code was not detecting excess input
      at the top level (only in nested levels).  Fortunately, we have
      code in monitor.c:qmp_check_client_args() that also checks for
      no excess arguments at the top level.  But as the generated code
      is more compact than the manual check, a later patch will clean
      up monitor.c to drop the redundancy added here.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-9-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      ed841535
    • E
      qmp-input: Don't consume input when checking has_member · e5826a2f
      Eric Blake 提交于
      Commit e8316d7e mistakenly passed consume=true within
      qmp_input_optional() when checking if an optional member was
      present, but the mistake was silently ignored since the code
      happily let us extract a member more than once.  Fix
      qmp_input_optional() to not consume anything, then tighten up
      the input visitor to ensure that a member is consumed exactly
      once (all generated code follows this pattern; and the new
      assert will catch any hand-written code that tries to visit
      the same key more than once).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-8-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      e5826a2f
    • E
      qapi: Use strict QMP input visitor in more places · 240f64b6
      Eric Blake 提交于
      The following uses of a QMP input visitor should be strict
      (that is, excess keys in QDict input should be flagged if not
      converted to QAPI):
      
      - Testsuite code unrelated to explicitly testing non-strict
      mode (test-qmp-commands, test-visitor-serialization); since
      we want more code to be strict by default, having more tests
      of strict mode doesn't hurt
      
      - Code used for cloning QAPI objects (replay-input.c,
      qemu-sockets.c); we are reparsing a QObject just barely
      produced by the qmp output visitor and which therefore should
      not have any garbage, so while it is extra work to be strict,
      it validates that our clone is correct [note that a later patch
      series will simplify these two uses by creating an actual
      clone visitor that is much more efficient than a
      generate/reparse cycle]
      
      - qmp_object_add(), which calls into user_creatable_add_type().
      Since command line parsing for '-object' uses the same
      user_creatable_add_type() through the OptsVisitor, and that is
      always strict, we want to ensure that any nested dictionaries
      would be treated the same in QMP and from the command line (I
      don't actually know if such nested dictionaries exist).  Note
      that on this code change, strictness only matters for nested
      dictionaries (if even possible), since we already flag excess
      input at the top level during an earlier object_property_set()
      on an unknown key, whether from QemuOpts:
      
      $ ./x86_64-softmmu/qemu-system-x86_64 -nographic -nodefaults -qmp stdio -object secret,id=sec0,data=letmein,format=raw,foo=bar
      qemu-system-x86_64: -object secret,id=sec0,data=letmein,format=raw,foo=bar: Property '.foo' not found
      
      or from QMP:
      
      $ ./x86_64-softmmu/qemu-system-x86_64 -nographic -nodefaults -qmp stdio
      {"QMP": {"version": {"qemu": {"micro": 93, "minor": 5, "major": 2}, "package": ""}, "capabilities": []}}
      {"execute":"qmp_capabilities"}
      {"return": {}}
      {"execute":"object-add","arguments":{"qom-type":"secret","id":"sec0","props":{"format":"raw","data":"letmein","foo":"bar"}}}
      {"error": {"class": "GenericError", "desc": "Property '.foo' not found"}}
      
      The only remaining uses of non-strict input visits are:
      
      - QMP 'qom-set' (which eventually executes
      object_property_set_qobject()) - mark it as something to revisit
      in the future (I didn't want to spend any more time on this patch
      auditing if we have any QOM dictionary properties that might be
      impacted, and couldn't easily prove whether this code path is
      shared with anything else).
      
      - test-qmp-input-visitor: explicit tests of non-strict mode. If
      we later get rid of users that don't need strictness, then this
      test should be merged with test-qmp-input-strict
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-7-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      240f64b6
    • E
      qapi: Consolidate QMP input visitor creation · fc471c18
      Eric Blake 提交于
      Rather than having two separate ways to create a QMP input
      visitor, where the safer approach has the more verbose name,
      it is better to consolidate things into a single function
      where the caller must explicitly choose whether to be strict
      or to ignore excess input.  This patch is the strictly
      mechanical conversion; the next patch will then audit which
      uses can be made stricter.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-6-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      fc471c18
    • E
      qmp-input: Clean up stack handling · b471d012
      Eric Blake 提交于
      Management of the top of stack was a bit verbose; creating a
      temporary variable and adding some comments makes the existing
      code more legible before the next few patches improve things.
      No semantic changes other than asserting that we are always
      visiting a QObject, and not a NULL value.  In particular, the
      check for 'name && qobject_type(qobj) == QTYPE_QDICT)' is a
      bit overkill (a dict visit should always have a name); a later
      patch revisits that, while this patch is only changing one
      layer of indentation due to dropping 'if (qobj)'.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-5-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      b471d012
    • E
      qmp: Drop dead command->type · 42a502a7
      Eric Blake 提交于
      Ever since QMP was first added back in commit 43c20a43, we have
      never had any QmpCommandType other than QCT_NORMAL.  It's
      pointless to carry around the cruft.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-4-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      42a502a7
    • E
      qapi: Guarantee NULL obj on input visitor callback error · e58d695e
      Eric Blake 提交于
      Our existing input visitors were not very consistent on errors in a
      function taking 'TYPE **obj'.  These are start_struct(),
      start_alternate(), type_str(), and type_any().  next_list() is
      similar, but can't fail (see commit 08f9541d).  While all of them set
      '*obj' to allocated storage on success, it was not obvious whether
      '*obj' was guaranteed safe on failure, or whether it was left
      uninitialized.  But a future patch wants to guarantee that
      visit_type_FOO() does not leak a partially-constructed obj back to
      the caller; it is easier to implement this if we can reliably state
      that input visitors assign '*obj' regardless of success or failure,
      and that on failure *obj is NULL.  Add assertions to enforce
      consistency in the final setting of err vs. *obj.
      
      The opts-visitor start_struct() doesn't set an error, but it
      also was doing a weird check for 0 size; all callers pass in
      non-zero size if obj is non-NULL.
      
      The testsuite has at least one spot where we no longer need
      to pre-initialize a variable prior to a visit; valgrind confirms
      that the test is still fine with the cleanup.
      
      A later patch will document the design constraint implemented
      here.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-3-git-send-email-eblake@redhat.com>
      [visit_start_alternate()'s assertion tightened, commit message tweaked]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      e58d695e
    • E
      qapi-visit: Add visitor.type classification · 983f52d4
      Eric Blake 提交于
      We have three classes of QAPI visitors: input, output, and dealloc.
      Currently, all implementations of these visitors have one thing in
      common based on their visitor type: the implementation used for the
      visit_type_enum() callback.  But since we plan to add more such
      common behavior, in relation to documenting and further refining
      the semantics, it makes more sense to have the visitor
      implementations advertise which class they belong to, so the common
      qapi-visit-core code can use that information in multiple places.
      
      A later patch will better document the types of visitors directly
      in visitor.h.
      
      For this patch, knowing the class of a visitor implementation lets
      us make input_type_enum() and output_type_enum() become static
      functions, by replacing the callback function Visitor.type_enum()
      with the simpler enum member Visitor.type.  Share a common
      assertion in qapi-visit-core as part of the refactoring.
      
      Move comments in opts-visitor.c to match the refactored layout.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1461879932-9020-2-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      983f52d4
  2. 11 5月, 2016 1 次提交
  3. 09 5月, 2016 2 次提交
  4. 03 5月, 2016 2 次提交
  5. 02 5月, 2016 7 次提交
    • G
      vga: make sure vga register setup for vbe stays intact (CVE-2016-3712). · fd3c136b
      Gerd Hoffmann 提交于
      Call vbe_update_vgaregs() when the guest touches GFX, SEQ or CRT
      registers, to make sure the vga registers will always have the
      values needed by vbe mode.  This makes sure the sanity checks
      applied by vbe_fixup_regs() are effective.
      
      Without this guests can muck with shift_control, can turn on planar
      vga modes or text mode emulation while VBE is active, making qemu
      take code paths meant for CGA compatibility, but with the very
      large display widths and heigts settable using VBE registers.
      
      Which is good for one or another buffer overflow.  Not that
      critical as they typically read overflows happening somewhere
      in the display code.  So guests can DoS by crashing qemu with a
      segfault, but it is probably not possible to break out of the VM.
      
      Fixes: CVE-2016-3712
      Reported-by: NZuozhi Fzz <zuozhi.fzz@alibaba-inc.com>
      Reported-by: NP J P <ppandit@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      fd3c136b
    • G
      vga: update vga register setup on vbe changes · 2068192d
      Gerd Hoffmann 提交于
      Call the new vbe_update_vgaregs() function on vbe configuration
      changes, to make sure vga registers are up-to-date.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      2068192d
    • G
      vga: factor out vga register setup · 7fa5c2c5
      Gerd Hoffmann 提交于
      When enabling vbe mode qemu will setup a bunch of vga registers to make
      sure the vga emulation operates in correct mode for a linear
      framebuffer.  Move that code to a separate function so we can call it
      from other places too.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      7fa5c2c5
    • G
      vga: add vbe_enabled() helper · bfa0f151
      Gerd Hoffmann 提交于
      Makes code a bit easier to read.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      bfa0f151
    • G
      vga: fix banked access bounds checking (CVE-2016-3710) · 3bf18170
      Gerd Hoffmann 提交于
      vga allows banked access to video memory using the window at 0xa00000
      and it supports a different access modes with different address
      calculations.
      
      The VBE bochs extentions support banked access too, using the
      VBE_DISPI_INDEX_BANK register.  The code tries to take the different
      address calculations into account and applies different limits to
      VBE_DISPI_INDEX_BANK depending on the current access mode.
      
      Which is probably effective in stopping misprogramming by accident.
      But from a security point of view completely useless as an attacker
      can easily change access modes after setting the bank register.
      
      Drop the bogus check, add range checks to vga_mem_{readb,writeb}
      instead.
      
      Fixes: CVE-2016-3710
      Reported-by: NQinghao Tang <luodalongde@gmail.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      3bf18170
    • J
      configure: Check if struct fsxattr is available from linux header · 277abf15
      Jan Vesely 提交于
      Fixes build failure with --enable-xfsctl and
      new linux headers (>=4.5) and older xfsprogs(<4.5):
      In file included from /usr/include/xfs/xfs.h:38:0,
                       from /var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/block/raw-posix.c:97:
      /usr/include/xfs/xfs_fs.h:42:8: error: redefinition of ‘struct fsxattr’
       struct fsxattr {
              ^
      In file included from /var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/block/raw-posix.c:60:0:
      /usr/include/linux/fs.h:155:8: note: originally defined here
       struct fsxattr {
      
      This is really a bug in the system headers, but we can work around it
      by defining HAVE_FSXATTR in the QEMU headers if linux/fs.h provides
      the struct, so that xfs_fs.h doesn't try to define it as well.
      
      CC: qemu-trivial@nongnu.org
      CC: Markus Armbruster <armbru@redhat.com>
      CC: Peter Maydell <peter.maydell@linaro.org>
      CC: Stefan Weil <sw@weilnetz.de>
      Tested-by: NStefan Weil <sw@weilnetz.de>
      Signed-off-by: NJan Vesely <jano.vesely@gmail.com>
      [PMM: adjusted commit message, comments]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      277abf15
    • P
      Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging · 20b0f5fe
      Peter Maydell 提交于
      acpi: last minute fix for 2.6
      
      Minor, obvious fix only affecting BE hosts.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      
      # gpg: Signature made Sun 01 May 2016 13:43:28 BST using RSA key ID D28D5469
      # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
      # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"
      
      * remotes/mst/tags/for_upstream:
        acpi: fix bios linker loadder COMMAND_ALLOCATE on bigendian host
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      20b0f5fe
  6. 01 5月, 2016 1 次提交
  7. 29 4月, 2016 6 次提交
  8. 28 4月, 2016 3 次提交
    • P
      Merge remote-tracking branch 'remotes/lalrae/tags/mips-20160428' into staging · 8c4bf975
      Peter Maydell 提交于
      MIPS patches 2016-04-28
      
      Changes:
      * fixed RDHWR exception host PC
      
      # gpg: Signature made Thu 28 Apr 2016 10:11:18 BST using RSA key ID 0B29DA6B
      # gpg: Good signature from "Leon Alrae <leon.alrae@imgtec.com>"
      
      * remotes/lalrae/tags/mips-20160428:
        target-mips: Fix RDHWR exception host PC
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      8c4bf975
    • P
      Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2016-04-28' into staging · 736f85d5
      Peter Maydell 提交于
      Fix dangling pointers and error message regressions
      
      # gpg: Signature made Thu 28 Apr 2016 07:25:51 BST using RSA key ID EB918653
      # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
      # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
      
      * remotes/armbru/tags/pull-error-2016-04-28:
        qom: -object error messages lost location, restore it
        replay: Fix dangling location bug in replay_configure()
        QemuOpts: Fix qemu_opts_foreach() dangling location regression
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      736f85d5
    • P
      Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.6-20160426' into staging · 61861eff
      Peter Maydell 提交于
      ppc patch queue for 2016-04-26 (last minute qemu-2.6 fix)
      
      This just has one, last-minute, fix for a serious regression of memory
      hotplug.
      
      Patch author's comment:
          Really sorry for the way last-minute fix, but without this memory
          hotplug is totally broken :( Hoping to get this in for Wednesday's
          RC4, which I think will be the final before release.
      
      # gpg: Signature made Tue 26 Apr 2016 03:52:20 BST using RSA key ID 20D9B392
      # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>"
      # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>"
      # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>"
      # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
      # gpg:          It is not certain that the signature belongs to the owner.
      # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
      
      * remotes/dgibson/tags/ppc-for-2.6-20160426:
        spapr_drc: fix aborts during DRC-count based hotplug
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      61861eff