qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] c42e77: qemu/osdep: Remove fallback for MAP_F


From: Richard Henderson
Subject: [Qemu-commits] [qemu/qemu] c42e77: qemu/osdep: Remove fallback for MAP_FIXED_NOREPLACE
Date: Wed, 09 Aug 2023 15:03:18 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: c42e77a90d9244c8caf76fe0e54f84200430a4e1
      
https://github.com/qemu/qemu/commit/c42e77a90d9244c8caf76fe0e54f84200430a4e1
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-08-08 (Tue, 08 Aug 2023)

  Changed paths:
    M include/qemu/osdep.h

  Log Message:
  -----------
  qemu/osdep: Remove fallback for MAP_FIXED_NOREPLACE

In order for our emulation of MAP_FIXED_NOREPLACE to succeed within
linux-user target_mmap, we require a non-zero value.  This does not
require host kernel support, merely the bit being defined.

MAP_FIXED_NOREPLACE was added with glibc 2.28.  From repology.org:

                  Fedora 36: 2.35
          CentOS 8 (RHEL-8): 2.28
                  Debian 11: 2.31
         OpenSUSE Leap 15.4: 2.31
           Ubuntu LTS 20.04: 2.31

Reported-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230808164418.69989-1-richard.henderson@linaro.org>


  Commit: 6c8f8456cb0b239812dee5211881426496da7b98
      
https://github.com/qemu/qemu/commit/6c8f8456cb0b239812dee5211881426496da7b98
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M hw/nvme/ctrl.c

  Log Message:
  -----------
  hw/nvme: fix null pointer access in directive receive

nvme_directive_receive() does not check if an endurance group has been
configured (set) prior to testing if flexible data placement is enabled
or not.

Fix this.

Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1815
Fixes: 73064edfb864 ("hw/nvme: flexible data placement emulation")
Reviewed-by: Jesper Wendel Devantier <j.devantier@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 3439ba9c5da943d96f7a3c86e0a7eb2ff48de41c
      
https://github.com/qemu/qemu/commit/3439ba9c5da943d96f7a3c86e0a7eb2ff48de41c
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M hw/nvme/ctrl.c

  Log Message:
  -----------
  hw/nvme: fix null pointer access in ruh update

The Reclaim Unit Update operation in I/O Management Receive does not
verify the presence of a configured endurance group prior to accessing
it.

Fix this.

Cc: qemu-stable@nongnu.org
Fixes: 73064edfb864 ("hw/nvme: flexible data placement emulation")
Reviewed-by: Jesper Wendel Devantier <j.devantier@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 9ab8d0714964abce6f5b8bcac49d6239c548ed12
      
https://github.com/qemu/qemu/commit/9ab8d0714964abce6f5b8bcac49d6239c548ed12
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Split out do_mmap

New function that rejects unsupported map types and flags.
In 4b840f96 we should not have accepted MAP_SHARED_VALIDATE
without actually validating the rest of the flags.

Fixes: 4b840f96 ("linux-user: Populate more bits in mmap_flags_tbl")
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: a05cee93f4052179c036789c5a246948dcc362f0
      
https://github.com/qemu/qemu/commit/a05cee93f4052179c036789c5a246948dcc362f0
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M bsd-user/syscall_defs.h
    M include/exec/user/thunk.h
    M linux-user/syscall.c
    M linux-user/thunk.c

  Log Message:
  -----------
  linux-user: Use ARRAY_SIZE with bitmask_transtbl

Rather than using a zero tuple to end the table, use a macro
to apply ARRAY_SIZE and pass that on to the convert functions.

This fixes two bugs in which the conversion functions required
that both the target and host masks be non-zero in order to
continue, rather than require both target and host masks be
zero in order to terminate.

This affected mmap_flags_tbl when the host does not support
all of the flags we wish to convert (e.g. MAP_UNINITIALIZED).
Mapping these flags to zero is good enough, and matches how
the kernel ignores bits that are unknown.

Fixes: 4b840f96 ("linux-user: Populate more bits in mmap_flags_tbl")
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 1b65895ddd9bb3898458ec622f5550173f9a8550
      
https://github.com/qemu/qemu/commit/1b65895ddd9bb3898458ec622f5550173f9a8550
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M tests/tcg/multiarch/gdbstub/test-proc-mappings.py

  Log Message:
  -----------
  tests/tcg: Disable filename test for info proc mappings

This test fails when host page size != guest page size,
because qemu may not be able to directly map the file.

Fixes: a6341482695 ("tests/tcg: Add a test for info proc mappings")
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 47d1e982318a0d97c557ce349ea9e2b601554055
      
https://github.com/qemu/qemu/commit/47d1e982318a0d97c557ce349ea9e2b601554055
  Author: Helge Deller <deller@gmx.de>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M util/interval-tree.c

  Log Message:
  -----------
  util/interval-tree: Check root for null in interval_tree_iter_first

Fix a crash in qemu-user when running

    cat /proc/self/maps

in a chroot, where /proc isn't mounted.

The problem was introduced by commit 3ce3dd8ca965 ("util/selfmap:
Rewrite using qemu/interval-tree.h") where in open_self_maps_1() the
function read_self_maps() is called and which returns NULL if it can't
read the hosts /proc/self/maps file. Afterwards that NULL is fed into
interval_tree_iter_first() which doesn't check if the root node is NULL.

Fix it by adding a check if root is NULL and return NULL in that case.

Signed-off-by: Helge Deller <deller@gmx.de>
Fixes: 3ce3dd8ca965 ("util/selfmap: Rewrite using qemu/interval-tree.h")
Message-Id: <ZNOsq6Z7t/eyIG/9@p100>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: b8002058c45a50d893c51cf62ec96c70128fc1eb
      
https://github.com/qemu/qemu/commit/b8002058c45a50d893c51cf62ec96c70128fc1eb
  Author: Helge Deller <deller@gmx.de>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Fix openat() emulation to correctly detect accesses to /proc

In qemu we catch accesses to files like /proc/cpuinfo or /proc/net/route
and return to the guest contents which would be visible on a real system
(instead what the host would show).

This patch fixes a bug, where for example the accesses
    cat /proc////cpuinfo
or
    cd /proc && cat cpuinfo
will not be recognized by qemu and where qemu will wrongly show
the contents of the host's /proc/cpuinfo file.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230803214450.647040-2-deller@gmx.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: c0b7823b2d1496771e0e0b20bd2fb96343ed9d17
      
https://github.com/qemu/qemu/commit/c0b7823b2d1496771e0e0b20bd2fb96343ed9d17
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M hw/nvme/ctrl.c

  Log Message:
  -----------
  Merge tag 'nvme-fixes-pull-request' of https://gitlab.com/birkelund/qemu into 
staging

hw/nvme: fixes

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEEUigzqnXi3OaiR2bATeGvMW1PDekFAmTTlmcACgkQTeGvMW1P
# DemjjggAnhEvaJ4fgS9rsvtxCwtzLNc405xMpNxh6rPaxa+sL3RXPIrW6vWG13+W
# VcHw8DI8EV4DzAFP919ZmTUq9/boRbgxx84bStlILUPHWol8+eGYVVfT75wFKszx
# d4Vi3nyPSGlrxieSrosARqimcUDtFtDGGAxjvEcKgzhkcU3a8DVYAOmx/hdlWJJQ
# KSk4h/E1pKItFbvv+w9yszsbToeZN65oIy7kQtFgx0JOULyWvEYSVygotw/AruF3
# FPQ0nrJuZ115w3cJWDszznVJ6+3EcWbD3luQc3zE1FOPp76EkAOkcnPh1XbBJrE2
# 2BsCX/XnXcZT7BWSJbEzGXLsHjqsPg==
# =Zy0+
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 09 Aug 2023 06:36:39 AM PDT
# gpg:                using RSA key 522833AA75E2DCE6A24766C04DE1AF316D4F0DE9
# gpg: Good signature from "Klaus Jensen <its@irrelevant.dk>" [unknown]
# gpg:                 aka "Klaus Jensen <k.jensen@samsung.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: DDCA 4D9C 9EF9 31CC 3468  4272 63D5 6FC5 E55D A838
#      Subkey fingerprint: 5228 33AA 75E2 DCE6 A247  66C0 4DE1 AF31 6D4F 0DE9

* tag 'nvme-fixes-pull-request' of https://gitlab.com/birkelund/qemu:
  hw/nvme: fix null pointer access in ruh update
  hw/nvme: fix null pointer access in directive receive

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: e53e2e2a1bfe2dbf11333875705a0064e1183c0b
      
https://github.com/qemu/qemu/commit/e53e2e2a1bfe2dbf11333875705a0064e1183c0b
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M bsd-user/syscall_defs.h
    M include/exec/user/thunk.h
    M include/qemu/osdep.h
    M linux-user/syscall.c
    M linux-user/thunk.c
    M tests/tcg/multiarch/gdbstub/test-proc-mappings.py
    M util/interval-tree.c

  Log Message:
  -----------
  Merge tag 'pull-lu-20230809' of https://gitlab.com/rth7680/qemu into staging

linux-user: Fixes for mmap syscall emulation
linux-user: Correctly detect access to /proc in openat
util/interval-tree: Check root for null in interval_tree_iter_first
tests/tcg: Disable filename test for info proc mappings

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmTT0O4dHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV9NeQf/SGtJsvcMdPPcOt1P
# ZK9fBK+gS9XzWvkquSL2wehs0ZY61u2IHznIqsFxhhmPqNTZPKb27u6Cg8DCxYdw
# Hc+YMtjx2MOBv2pXTCc14XWkTsclP2jJaf2VUFIR/MowBJb7Xcgbv53PvRnCn3xT
# KC80Pm6eJZFT0EkQZwHbT8doakkjyIx8JIapdNFvD6Ne0CWCKOwDK9sF5ob1Tf5g
# BXyCw5ZtnCiToYw+RpBnhZ1wsInV+o/MV7FwcgrxGWB+4ovwRLknBzAggHvhz3ZO
# pdCqvobBtUk88+txMX6ewIDYU9BsuOnWDR+j99MD9/kPtbgSLlRYzxJ0PAjCMG6m
# xu0Tyg==
# =n1TD
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 09 Aug 2023 10:46:22 AM PDT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" 
[ultimate]

* tag 'pull-lu-20230809' of https://gitlab.com/rth7680/qemu:
  linux-user: Fix openat() emulation to correctly detect accesses to /proc
  util/interval-tree: Check root for null in interval_tree_iter_first
  tests/tcg: Disable filename test for info proc mappings
  linux-user: Use ARRAY_SIZE with bitmask_transtbl
  linux-user: Split out do_mmap
  qemu/osdep: Remove fallback for MAP_FIXED_NOREPLACE

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Compare: https://github.com/qemu/qemu/compare/a8fc5165aab0...e53e2e2a1bfe



reply via email to

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