1. 17 3月, 2017 2 次提交
    • S
      file-posix: clean up max_segments buffer termination · 69583490
      Stefan Hajnoczi 提交于
      The following pattern is unsafe:
      
        char buf[32];
        ret = read(fd, buf, sizeof(buf));
        ...
        buf[ret] = 0;
      
      If read(2) returns 32 then a byte beyond the end of the buffer is
      zeroed.
      
      In practice this buffer overflow does not occur because the sysfs
      max_segments file only contains an unsigned short + '\n'.  The string is
      always shorter than 32 bytes.
      
      Regardless, avoid this pattern because static analysis tools might
      complain and it could lead to real buffer overflows if copy-pasted
      elsewhere in the codebase.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      69583490
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/pull-cirrus-20170316-1' into staging · 272d7dee
      Peter Maydell 提交于
      cirrus: blitter fixes.
      
      # gpg: Signature made Thu 16 Mar 2017 09:05:22 GMT
      # gpg:                using RSA key 0x4CB6D8EED3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
      # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
      
      * remotes/kraxel/tags/pull-cirrus-20170316-1:
        cirrus: stop passing around src pointers in the blitter
        cirrus: stop passing around dst pointers in the blitter
        cirrus: fix cirrus_invalidate_region
        cirrus: add option to disable blitter
        cirrus: switch to 4 MB video memory by default
        cirrus/vnc: zap bitblit support from console code.
        fix :cirrus_vga fix OOB read case qemu Segmentation fault
      
      # Conflicts:
      #	include/hw/compat.h
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      272d7dee
  2. 16 3月, 2017 38 次提交