qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 65ceee: tests/9pfs: use g_autofree where poss


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 65ceee: tests/9pfs: use g_autofree where possible
Date: Sat, 19 Feb 2022 05:00:07 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 65ceee0ae5475589be0a22831860430c7c10bf52
      
https://github.com/qemu/qemu/commit/65ceee0ae5475589be0a22831860430c7c10bf52
  Author: Christian Schoenebeck <qemu_oss@crudebyte.com>
  Date:   2022-02-17 (Thu, 17 Feb 2022)

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

  Log Message:
  -----------
  tests/9pfs: use g_autofree where possible

Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <E1mn1fA-0005qZ-TM@lizzy.crudebyte.com>


  Commit: 68c66a96c8393d482599bf56f1c13c7ae3e13ec1
      
https://github.com/qemu/qemu/commit/68c66a96c8393d482599bf56f1c13c7ae3e13ec1
  Author: Christian Schoenebeck <qemu_oss@crudebyte.com>
  Date:   2022-02-17 (Thu, 17 Feb 2022)

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

  Log Message:
  -----------
  tests/9pfs: fix mkdir() being called twice

The 9p test cases use mkdtemp() to create a temporary directory for
running the 'local' 9p tests with real files/dirs. Unlike mktemp()
which only generates a unique file name, mkdtemp() also creates the
directory, therefore the subsequent mkdir() was wrong and caused
errors on some systems.

Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Fixes: 136b7af2 (tests/9pfs: fix test dir for parallel tests)
Reported-by: Daniel P. Berrangé <berrange@redhat.com>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/832
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Greg Kurz <Greg Kurz <groug@kaod.org>
Message-Id: 
<f6602123c6f7d0d593466231b04fba087817abbd.1642879848.git.qemu_oss@crudebyte.com>


  Commit: ba6112e40c03594cf4e3a7a6ebf52341153e7496
      
https://github.com/qemu/qemu/commit/ba6112e40c03594cf4e3a7a6ebf52341153e7496
  Author: Greg Kurz <groug@kaod.org>
  Date:   2022-02-17 (Thu, 17 Feb 2022)

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

  Log Message:
  -----------
  tests/9pfs: Fix leak of local_test_path

local_test_path is allocated in virtio_9p_create_local_test_dir() to hold the 
path
of the temporary directory. It should be freed in 
virtio_9p_remove_local_test_dir()
when the temporary directory is removed. Clarify the lifecycle of 
local_test_path
while here.

Based-on: 
<f6602123c6f7d0d593466231b04fba087817abbd.1642879848.git.qemu_oss@crudebyte.com>
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20220201151508.190035-2-groug@kaod.org>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>


  Commit: 494fbbd3ed46a14ef0924651c058b9b0dcb4a7b4
      
https://github.com/qemu/qemu/commit/494fbbd3ed46a14ef0924651c058b9b0dcb4a7b4
  Author: Greg Kurz <groug@kaod.org>
  Date:   2022-02-17 (Thu, 17 Feb 2022)

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

  Log Message:
  -----------
  tests/9pfs: Use g_autofree and g_autoptr where possible

It is recommended to use g_autofree or g_autoptr as it reduces
the odds of introducing memory leaks in future changes.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20220201151508.190035-3-groug@kaod.org>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>


  Commit: e64e27d5cb103b7764f1a05b6eda7e7fedd517c5
      
https://github.com/qemu/qemu/commit/e64e27d5cb103b7764f1a05b6eda7e7fedd517c5
  Author: Vitaly Chikunov <vt@altlinux.org>
  Date:   2022-02-17 (Thu, 17 Feb 2022)

  Changed paths:
    M hw/9pfs/9p-synth.c
    M hw/9pfs/9p-synth.h
    M hw/9pfs/codir.c
    M include/qemu/osdep.h
    M util/osdep.c

  Log Message:
  -----------
  9pfs: Fix segfault in do_readdir_many caused by struct dirent overread

`struct dirent' returned from readdir(3) could be shorter (or longer)
than `sizeof(struct dirent)', thus memcpy of sizeof length will overread
into unallocated page causing SIGSEGV. Example stack trace:

 #0  0x00005555559ebeed v9fs_co_readdir_many (/usr/bin/qemu-system-x86_64 + 
0x497eed)
 #1  0x00005555559ec2e9 v9fs_readdir (/usr/bin/qemu-system-x86_64 + 0x4982e9)
 #2  0x0000555555eb7983 coroutine_trampoline (/usr/bin/qemu-system-x86_64 + 
0x963983)
 #3  0x00007ffff73e0be0 n/a (n/a + 0x0)

While fixing this, provide a helper for any future `struct dirent' cloning.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/841
Cc: qemu-stable@nongnu.org
Co-authored-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
Tested-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Acked-by: Greg Kurz <groug@kaod.org>
Tested-by: Vitaly Chikunov <vt@altlinux.org>
Message-Id: <20220216181821.3481527-1-vt@altlinux.org>
[C.S. - Fix typo in source comment. ]
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>


  Commit: 439346ce8fa32095433a9abb2aa3564d11283372
      
https://github.com/qemu/qemu/commit/439346ce8fa32095433a9abb2aa3564d11283372
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2022-02-19 (Sat, 19 Feb 2022)

  Changed paths:
    M hw/9pfs/9p-synth.c
    M hw/9pfs/9p-synth.h
    M hw/9pfs/codir.c
    M include/qemu/osdep.h
    M tests/qtest/libqos/virtio-9p.c
    M tests/qtest/virtio-9p-test.c
    M util/osdep.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/cschoenebeck/tags/pull-9p-20220217' 
into staging

9pfs: fixes and cleanup

* Fifth patch fixes a 9pfs server crash that happened on some systems due
  to incorrect (system dependant) handling of struct dirent size.

* Tests: Second patch fixes a test error that happened on some systems due
  mkdir() being called twice for creating the test directory for the 9p
  'local' tests.

* Tests: Third patch fixes a memory leak.

* Tests: The remaining two patches are code cleanup.

# gpg: Signature made Thu 17 Feb 2022 16:19:25 GMT
# gpg:                using RSA key 96D8D110CF7AF8084F88590134C2B58765A47395
# gpg:                issuer "qemu_oss@crudebyte.com"
# gpg: Good signature from "Christian Schoenebeck <qemu_oss@crudebyte.com>" 
[unknown]
# 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: ECAB 1A45 4014 1413 BA38  4926 30DB 47C3 A012 D5F4
#      Subkey fingerprint: 96D8 D110 CF7A F808 4F88  5901 34C2 B587 65A4 7395

* remotes/cschoenebeck/tags/pull-9p-20220217:
  9pfs: Fix segfault in do_readdir_many caused by struct dirent overread
  tests/9pfs: Use g_autofree and g_autoptr where possible
  tests/9pfs: Fix leak of local_test_path
  tests/9pfs: fix mkdir() being called twice
  tests/9pfs: use g_autofree where possible

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


Compare: https://github.com/qemu/qemu/compare/786ad5aa530e...439346ce8fa3



reply via email to

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