qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 4cfd97: util: fix abstract socket path copy


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 4cfd97: util: fix abstract socket path copy
Date: Thu, 05 Aug 2021 10:47:43 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 4cfd970ec188558daa6214f26203fe553fb1e01f
      
https://github.com/qemu/qemu/commit/4cfd970ec188558daa6214f26203fe553fb1e01f
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2021-08-04 (Wed, 04 Aug 2021)

  Changed paths:
    M util/qemu-sockets.c

  Log Message:
  -----------
  util: fix abstract socket path copy

Commit 776b97d360 "qemu-sockets: add abstract UNIX domain socket
support" neglected to update socket_sockaddr_to_address_unix() and
copied the whole sun_path without taking "salen" into account.

Later, commit 3b14b4ec49 "sockets: Fix socket_sockaddr_to_address_unix()
for abstract sockets" handled the abstract UNIX path, by stripping the
leading \0 character and fixing address details, but didn't use salen
either.

Not taking "salen" into account may result in incorrect "path" being
returned in monitors commands, as we read past the address which is not
necessarily \0-terminated.

Fixes: 776b97d3605ed0fc94443048fdf988c7725e38a9
Fixes: 3b14b4ec49a801067da19d6b8469eb1c1911c020
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: xiaoqiang zhao <zxq_yx_007@163.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 30f80be34ba6142dc7ba2015b98d661a9529b7c5
      
https://github.com/qemu/qemu/commit/30f80be34ba6142dc7ba2015b98d661a9529b7c5
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2021-08-04 (Wed, 04 Aug 2021)

  Changed paths:
    M chardev/char-socket.c

  Log Message:
  -----------
  chardev/socket: print a more correct command-line address

Better reflect the command line version of the socket address arguments,
following the now recommended long-form opt=on syntax.

Complement/fixes commit 9d902d51 "chardev: do not use short form boolean
options in non-QemuOpts character device descriptions".

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


  Commit: bf7b1eab252bc56b6bbb12a8909eae738435d6ae
      
https://github.com/qemu/qemu/commit/bf7b1eab252bc56b6bbb12a8909eae738435d6ae
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2021-08-05 (Thu, 05 Aug 2021)

  Changed paths:
    M chardev/char-fe.c
    M hw/char/cadence_uart.c
    M hw/char/cmsdk-apb-uart.c
    M hw/char/ibex_uart.c
    M hw/char/nrf51_uart.c
    M hw/char/serial.c
    M hw/char/virtio-console.c
    M hw/usb/redirect.c
    M hw/virtio/vhost-user.c
    M include/chardev/char-fe.h
    M monitor/monitor.c
    M net/vhost-user.c

  Log Message:
  -----------
  chardev: mark explicitly first argument as poisoned

Since commit 9894dc0cdcc397ee5b26370bc53da6d360a363c2 "char: convert
from GIOChannel to QIOChannel", the first argument to the watch callback
can actually be a QIOChannel, which is not a GIOChannel (but a QEMU
Object).

Even though we never used that pointer, change the callback type to warn
the users. Possibly a better fix later, we may want to store the
callback and call it from intermediary functions.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: bb2b058f1a4e4fe9031133f2f7876fb12b2104d7
      
https://github.com/qemu/qemu/commit/bb2b058f1a4e4fe9031133f2f7876fb12b2104d7
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2021-08-05 (Thu, 05 Aug 2021)

  Changed paths:
    M chardev/char-fd.c

  Log Message:
  -----------
  chardev: fix fd_chr_add_watch() when in != out

Create child sources for the different streams, and dispatch on the
parent source with the synthesized conditions.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 46fe3ff6ea3e7a642b8545c0322ef5df873bd560
      
https://github.com/qemu/qemu/commit/46fe3ff6ea3e7a642b8545c0322ef5df873bd560
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2021-08-05 (Thu, 05 Aug 2021)

  Changed paths:
    M chardev/char-fd.c

  Log Message:
  -----------
  chardev: fix qemu_chr_open_fd() being called with fd=-1

The "file" chardev may call qemu_chr_open_fd() with fd_in=-1. This may
cause invalid system calls, as the QIOChannel is assumed to be properly
initialized later on.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 733ba020846ccd21d832f2e9b62387a86c5ab8f1
      
https://github.com/qemu/qemu/commit/733ba020846ccd21d832f2e9b62387a86c5ab8f1
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2021-08-05 (Thu, 05 Aug 2021)

  Changed paths:
    M chardev/char-fd.c

  Log Message:
  -----------
  chardev: fix qemu_chr_open_fd() with fd_in==fd_out

The "serial" chardev calls qemu_chr_open_fd() with the same fd. This
may lead to double-close as each QIOChannel owns the fd.

Instead, share the reference to the same QIOChannel.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 64195b0d365712c05ae922b7ff22cf136aac1400
      
https://github.com/qemu/qemu/commit/64195b0d365712c05ae922b7ff22cf136aac1400
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2021-08-05 (Thu, 05 Aug 2021)

  Changed paths:
    M chardev/char.c

  Log Message:
  -----------
  chardev: give some context on chardev-add error

Description from Daniel P. Berrangé:
> The original code reported:
>
>  "attempt to add duplicate property 'char2' to object (type 'container')"
>
> Since adding yank support, the current code reports
>
>  "duplicate yank instance"
>
> With this patch applied it now reports:
>
>  "Failed to add chardev 'char2': duplicate yank instance"
>
> This is marginally better, but still not great, not that the original
> error was great either.
>
> It would be nice if we could report
>
>   "chardev with id 'char2' already exists"

Related to:
https://bugzilla.redhat.com/show_bug.cgi?id=1984721

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: a68403b0a6843f106e381b0bbeaacb29f6d27255
      
https://github.com/qemu/qemu/commit/a68403b0a6843f106e381b0bbeaacb29f6d27255
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2021-08-05 (Thu, 05 Aug 2021)

  Changed paths:
    M chardev/char.c

  Log Message:
  -----------
  chardev: report a simpler error about duplicated id

Report:
  "Chardev with id 'char2' already exists"
Rather than:
  "Failed to add chardev 'char2': duplicate yank instance"

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 287d53398a425308629a9d8ae85595cf55d7bf14
      
https://github.com/qemu/qemu/commit/287d53398a425308629a9d8ae85595cf55d7bf14
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-08-05 (Thu, 05 Aug 2021)

  Changed paths:
    M chardev/char-fd.c
    M chardev/char-fe.c
    M chardev/char-socket.c
    M chardev/char.c
    M hw/char/cadence_uart.c
    M hw/char/cmsdk-apb-uart.c
    M hw/char/ibex_uart.c
    M hw/char/nrf51_uart.c
    M hw/char/serial.c
    M hw/char/virtio-console.c
    M hw/usb/redirect.c
    M hw/virtio/vhost-user.c
    M include/chardev/char-fe.h
    M monitor/monitor.c
    M net/vhost-user.c
    M util/qemu-sockets.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/marcandre/tags/chr-fix-pull-request' 
into staging

Chardev-related fixes

Hi

Here are some bug fixes worthy for 6.1.

thanks

# gpg: Signature made Thu 05 Aug 2021 13:52:03 BST
# gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
# gpg:                issuer "marcandre.lureau@redhat.com"
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" 
[full]
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" 
[full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* remotes/marcandre/tags/chr-fix-pull-request:
  chardev: report a simpler error about duplicated id
  chardev: give some context on chardev-add error
  chardev: fix qemu_chr_open_fd() with fd_in==fd_out
  chardev: fix qemu_chr_open_fd() being called with fd=-1
  chardev: fix fd_chr_add_watch() when in != out
  chardev: mark explicitly first argument as poisoned
  chardev/socket: print a more correct command-line address
  util: fix abstract socket path copy

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/bccabb3a5d60...287d53398a42



reply via email to

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