qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] d63fb1: 9pfs: fix file descriptor leak


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] d63fb1: 9pfs: fix file descriptor leak
Date: Tue, 28 Mar 2017 02:30:12 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: d63fb193e71644a073b77ff5ac6f1216f2f6cf6e
      
https://github.com/qemu/qemu/commit/d63fb193e71644a073b77ff5ac6f1216f2f6cf6e
  Author: Li Qiang <address@hidden>
  Date:   2017-03-27 (Mon, 27 Mar 2017)

  Changed paths:
    M hw/9pfs/9p.c

  Log Message:
  -----------
  9pfs: fix file descriptor leak

The v9fs_create() and v9fs_lcreate() functions are used to create a file
on the backend and to associate it to a fid. The fid shouldn't be already
in-use, otherwise both functions may silently leak a file descriptor or
allocated memory. The current code doesn't check that.

This patch ensures that the fid isn't already associated to anything
before using it.

Signed-off-by: Li Qiang <address@hidden>
(reworded the changelog, Greg Kurz)
Signed-off-by: Greg Kurz <address@hidden>


  Commit: 34ef723ce34aaa14f94530c06a0ab3170a19bb59
      
https://github.com/qemu/qemu/commit/34ef723ce34aaa14f94530c06a0ab3170a19bb59
  Author: Peter Maydell <address@hidden>
  Date:   2017-03-27 (Mon, 27 Mar 2017)

  Changed paths:
    M tests/virtio-9p-test.c

  Log Message:
  -----------
  tests/virtio-9p-test: Don't call le*_to_cpus on fields of packed struct

For a packed struct like 'P9Hdr' the fields within it may not be
aligned as much as the natural alignment for their types.  This means
it is not valid to pass the address of such a field to a function
like le32_to_cpus() which operate on uint32_t* and assume alignment.
Doing this results in a SIGBUS on hosts like SPARC which have strict
alignment requirements.

Use ldl_le_p() instead, which is specified to correctly handle
unaligned pointers.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>


  Commit: 8c9ee217f0ee2a99d8aafa8a1db7f76176c18c99
      
https://github.com/qemu/qemu/commit/8c9ee217f0ee2a99d8aafa8a1db7f76176c18c99
  Author: Peter Maydell <address@hidden>
  Date:   2017-03-28 (Tue, 28 Mar 2017)

  Changed paths:
    M hw/9pfs/9p.c
    M tests/virtio-9p-test.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging

This series fixes potential memory/fd leaks in 9pfs and a crash when
running tests/virtio-9p-test on SPARC hosts.

# gpg: Signature made Tue 28 Mar 2017 09:44:05 BST
# gpg:                using DSA key 0x02FC3AEB0101DBC2
# gpg: Good signature from "Greg Kurz <address@hidden>"
# gpg:                 aka "Greg Kurz <address@hidden>"
# gpg:                 aka "Greg Kurz <address@hidden>"
# gpg:                 aka "Gregory Kurz (Groug) <address@hidden>"
# gpg:                 aka "[jpeg image of size 3330]"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 2BD4 3B44 535E C0A7 9894  DBA2 02FC 3AEB 0101 DBC2

* remotes/gkurz/tags/for-upstream:
  tests/virtio-9p-test: Don't call le*_to_cpus on fields of packed struct
  9pfs: fix file descriptor leak

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/eb06c9e2d3c8...8c9ee217f0ee

reply via email to

[Prev in Thread] Current Thread [Next in Thread]