qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 790db7: 9pfs: local: remove: use correct path


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 790db7: 9pfs: local: remove: use correct path component
Date: Thu, 29 Jun 2017 09:00:35 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 790db7efdbe1536acf1c4f4f95a0316dbda59433
      
https://github.com/qemu/qemu/commit/790db7efdbe1536acf1c4f4f95a0316dbda59433
  Author: Bruce Rogers <address@hidden>
  Date:   2017-06-29 (Thu, 29 Jun 2017)

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

  Log Message:
  -----------
  9pfs: local: remove: use correct path component

Commit a0e640a8 introduced a path processing error.
Pass fstatat the dirpath based path component instead
of the entire path.

Signed-off-by: Bruce Rogers <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>


  Commit: b96feb2cb9b2714bffa342b1d4f39d8db71329ba
      
https://github.com/qemu/qemu/commit/b96feb2cb9b2714bffa342b1d4f39d8db71329ba
  Author: Tobias Schramm <address@hidden>
  Date:   2017-06-29 (Thu, 29 Jun 2017)

  Changed paths:
    M fsdev/file-op-9p.h
    M fsdev/qemu-fsdev-opts.c
    M hw/9pfs/9p-local.c
    M hw/9pfs/9p.c
    M qemu-options.hx

  Log Message:
  -----------
  9pfs: local: Add support for custom fmode/dmode in 9ps mapped security modes

In mapped security modes, files are created with very restrictive
permissions (600 for files and 700 for directories). This makes
file sharing between virtual machines and users on the host rather
complicated. Imagine eg. a group of users that need to access data
produced by processes on a virtual machine. Giving those users access
to the data will be difficult since the group access mode is always 0.

This patch makes the default mode for both files and directories
configurable. Existing setups that don't know about the new parameters
keep using the current secure behavior.

Signed-off-by: Tobias Schramm <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>


  Commit: 453a1b234fc11570e332e91d58e4dbfeec7cb824
      
https://github.com/qemu/qemu/commit/453a1b234fc11570e332e91d58e4dbfeec7cb824
  Author: Marc-André Lureau <address@hidden>
  Date:   2017-06-29 (Thu, 29 Jun 2017)

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

  Log Message:
  -----------
  9pfs: replace g_malloc()+memcpy() with g_memdup()

I found these pattern via grepping the source tree. I don't have a
coccinelle script for it!

Signed-off-by: Marc-André Lureau <address@hidden>


  Commit: 3a21fb2af07ca6d22e39a766363befbf833f86bb
      
https://github.com/qemu/qemu/commit/3a21fb2af07ca6d22e39a766363befbf833f86bb
  Author: Greg Kurz <address@hidden>
  Date:   2017-06-29 (Thu, 29 Jun 2017)

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

  Log Message:
  -----------
  virtio-9p: record element after sanity checks

If the guest sends a malformed request, we end up with a dangling pointer
in V9fsVirtioState. This doesn't seem to cause any bug, but let's remove
this side effect anyway.

Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>


  Commit: a4d99854505ed63f5ea67fbfefb90316472cf158
      
https://github.com/qemu/qemu/commit/a4d99854505ed63f5ea67fbfefb90316472cf158
  Author: Greg Kurz <address@hidden>
  Date:   2017-06-29 (Thu, 29 Jun 2017)

  Changed paths:
    M hw/9pfs/9p.h
    M hw/9pfs/virtio-9p-device.c

  Log Message:
  -----------
  virtio-9p: message header is 7-byte long

The 9p spec at http://man.cat-v.org/plan_9/5/intro reads:

 "Each 9P message begins with a four-byte size field specify-
  ing the length in bytes of the complete message including
  the four bytes of the size field itself.  The next byte is
  the message type, one of the constants in the enumeration in
  the include file <fcall.h>.  The next two bytes are an iden-
  tifying tag, described below."

ie, each message starts with a 7-byte long header.

The core 9P code already assumes this pretty much everywhere. This patch
does the following:
- makes the assumption explicit in the common 9p.h header, since it isn't
  related to the transport
- open codes the header size in handle_9p_output() and hardens the sanity
  check on the space needed for the reply message

Signed-off-by: Greg Kurz <address@hidden>
Acked-by: Stefano Stabellini <address@hidden>


  Commit: 8d37de41cab145cbba250a8f1f1372b0a5cdf26f
      
https://github.com/qemu/qemu/commit/8d37de41cab145cbba250a8f1f1372b0a5cdf26f
  Author: Greg Kurz <address@hidden>
  Date:   2017-06-29 (Thu, 29 Jun 2017)

  Changed paths:
    M hw/9pfs/9p.c
    M hw/9pfs/9p.h
    M hw/9pfs/virtio-9p-device.c
    M hw/9pfs/xen-9p-backend.c

  Log Message:
  -----------
  virtio-9p: break device if buffers are misconfigured

The 9P protocol is transport agnostic: if the guest misconfigured the
buffers, the best we can do is to set the broken flag on the device.

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


  Commit: e08d1e11ed40b93e62ae8973159e6c1a306cd70e
      
https://github.com/qemu/qemu/commit/e08d1e11ed40b93e62ae8973159e6c1a306cd70e
  Author: Stefano Stabellini <address@hidden>
  Date:   2017-06-29 (Thu, 29 Jun 2017)

  Changed paths:
    M hw/9pfs/xen-9p-backend.c

  Log Message:
  -----------
  xen-9pfs: disconnect if buffers are misconfigured

Implement xen_9pfs_disconnect by unbinding the event channels. On
xen_9pfs_free, call disconnect if any event channels haven't been
disconnected.

If the frontend misconfigured the buffers set the backend to "Closing"
and disconnect it. Misconfigurations include requesting a read of more
bytes than available on the ring buffer, or claiming to be writing more
data than available on the ring buffer.

Signed-off-by: Stefano Stabellini <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>


  Commit: 06a37db7b12e4d42a6699c2fef820158f470ec4f
      
https://github.com/qemu/qemu/commit/06a37db7b12e4d42a6699c2fef820158f470ec4f
  Author: Greg Kurz <address@hidden>
  Date:   2017-06-29 (Thu, 29 Jun 2017)

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

  Log Message:
  -----------
  9pfs: handle transport errors in pdu_complete()

Contrary to what is written in the comment, a buggy guest can misconfigure
the transport buffers and pdu_marshal() may return an error.  If this ever
happens, it is up to the transport layer to handle the situation (9P is
transport agnostic).

This fixes Coverity issue CID1348518.

Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Stefano Stabellini <address@hidden>


  Commit: 454d7dc9bc13e46084e0612076e6952c40f4afeb
      
https://github.com/qemu/qemu/commit/454d7dc9bc13e46084e0612076e6952c40f4afeb
  Author: Peter Maydell <address@hidden>
  Date:   2017-06-29 (Thu, 29 Jun 2017)

  Changed paths:
    M fsdev/file-op-9p.h
    M fsdev/qemu-fsdev-opts.c
    M hw/9pfs/9p-local.c
    M hw/9pfs/9p-synth.c
    M hw/9pfs/9p.c
    M hw/9pfs/9p.h
    M hw/9pfs/virtio-9p-device.c
    M hw/9pfs/xen-9p-backend.c
    M qemu-options.hx

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

- fixes a minor bug that could possibly prevent old guests to remove
  directories
- makes default permissions for new files configurable from the cmdline
  when using mapped security modes
- handle transport errors
- g_malloc()+memcpy() converted to g_memdup()

# gpg: Signature made Thu 29 Jun 2017 14:12:42 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:
  9pfs: handle transport errors in pdu_complete()
  xen-9pfs: disconnect if buffers are misconfigured
  virtio-9p: break device if buffers are misconfigured
  virtio-9p: message header is 7-byte long
  virtio-9p: record element after sanity checks
  9pfs: replace g_malloc()+memcpy() with g_memdup()
  9pfs: local: Add support for custom fmode/dmode in 9ps mapped security modes
  9pfs: local: remove: use correct path component

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


Compare: https://github.com/qemu/qemu/compare/e72062490620...454d7dc9bc13

reply via email to

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