Skip to content
  • Markus Armbruster's avatar
    046aba16
    gdbstub: Reject invalid RLE repeat counts · 046aba16
    Markus Armbruster authored
    
    
    "Debugging with GDB / Appendix E GDB Remote Serial Protocol /
    Overview" specifies "The printable characters '#' and '$' or with a
    numeric value greater than 126 must not be used."  gdb_read_byte()
    only rejects values < 32.  This is wrong.  Impact depends on the caller:
    
    * gdb_handlesig() passes a char.  Incorrectly accepts '#', '$' and
      '\127'.
    
    * gdb_chr_receive() passes an uint8_t.  Additionally accepts
      characters with the most-significant bit set.
    
    Correct the validity check to match the specification.
    
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20190514180311.16028-4-armbru@redhat.com>
    046aba16
    gdbstub: Reject invalid RLE repeat counts
    Markus Armbruster authored
    
    
    "Debugging with GDB / Appendix E GDB Remote Serial Protocol /
    Overview" specifies "The printable characters '#' and '$' or with a
    numeric value greater than 126 must not be used."  gdb_read_byte()
    only rejects values < 32.  This is wrong.  Impact depends on the caller:
    
    * gdb_handlesig() passes a char.  Incorrectly accepts '#', '$' and
      '\127'.
    
    * gdb_chr_receive() passes an uint8_t.  Additionally accepts
      characters with the most-significant bit set.
    
    Correct the validity check to match the specification.
    
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20190514180311.16028-4-armbru@redhat.com>
Loading