No description
Find a file
Michael S. Tsirkin 573a3228ca virtio: acknowledge all features before access
commit 4fa59ede95 upstream.

The feature negotiation was designed in a way that
makes it possible for devices to know which config
fields will be accessed by drivers.

This is broken since commit 404123c2db ("virtio: allow drivers to
validate features") with fallout in at least block and net.  We have a
partial work-around in commit 2f9a174f91 ("virtio: write back
F_VERSION_1 before validate") which at least lets devices find out which
format should config space have, but this is a partial fix: guests
should not access config space without acknowledging features since
otherwise we'll never be able to change the config space format.

To fix, split finalize_features from virtio_finalize_features and
call finalize_features with all feature bits before validation,
and then - if validation changed any bits - once again after.

Since virtio_finalize_features no longer writes out features
rename it to virtio_features_ok - since that is what it does:
checks that features are ok with the device.

As a side effect, this also reduces the amount of hypervisor accesses -
we now only acknowledge features once unless we are clearing any
features when validating (which is uncommon).

IRC I think that this was more or less always the intent in the spec but
unfortunately the way the spec is worded does not say this explicitly, I
plan to address this at the spec level, too.

Acked-by: Jason Wang <jasowang@redhat.com>
Cc: stable@vger.kernel.org
Fixes: 404123c2db ("virtio: allow drivers to validate features")
Fixes: 2f9a174f91 ("virtio: write back F_VERSION_1 before validate")
Cc: "Halil Pasic" <pasic@linux.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-16 14:16:02 +01:00
arch arm64: dts: marvell: armada-37xx: Remap IO space to bus address 0x0 2022-03-16 14:16:01 +01:00
block block/wbt: fix negative inflight counter when remove scsi device 2022-02-23 12:01:04 +01:00
certs certs: Trigger creation of RSA module signing key if it's not an RSA key 2021-09-15 09:50:29 +02:00
crypto crypto: api - Move cryptomgr soft dependency into algapi 2022-02-11 09:09:03 +01:00
Documentation arm64: cpufeature: add HWCAP for FEAT_RPRES 2022-03-11 12:11:51 +01:00
drivers virtio: acknowledge all features before access 2022-03-16 14:16:02 +01:00
fs fuse: fix pipe buffer lifetime for direct_io 2022-03-16 14:16:01 +01:00
include virtio: acknowledge all features before access 2022-03-16 14:16:02 +01:00
init bpf: Add kconfig knob for disabling unpriv bpf by default 2022-01-05 12:40:34 +01:00
ipc shm: extend forced shm destroy to support objects from several IPC nses 2021-12-01 09:19:10 +01:00
kernel tracing: Ensure trace buffer is at least 4096 bytes large 2022-03-16 14:16:00 +01:00
lib lib/iov_iter: initialize "flags" in new pipe_buffer 2022-02-23 12:01:06 +01:00
LICENSES LICENSES/deprecated: add Zlib license text 2020-09-16 14:33:49 +02:00
mm memfd: fix F_SEAL_WRITE after shmem huge page allocated 2022-03-08 19:09:36 +01:00
net ipv6: prevent a possible race condition with lifetimes 2022-03-16 14:16:00 +01:00
samples ftrace/samples: Add missing prototypes direct functions 2022-01-11 15:25:00 +01:00
scripts kconfig: fix failing to generate auto.conf 2022-02-23 12:01:07 +01:00
security ima: Do not print policy rule with inactive LSM labels 2022-02-16 12:54:16 +01:00
sound ASoC: cs4265: Fix the duplicated control name 2022-03-08 19:09:35 +01:00
tools selftests/memfd: clean up mapping in mfd_fail_write 2022-03-16 14:16:01 +01:00
usr usr/include/Makefile: add linux/nfc.h to the compile-test coverage 2022-02-01 17:25:48 +01:00
virt KVM: eventfd: Fix false positive RCU usage warning 2022-02-16 12:54:20 +01:00
.clang-format RDMA 5.10 pull request 2020-10-17 11:18:18 -07:00
.cocciconfig
.get_maintainer.ignore
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore kbuild: generate Module.symvers only when vmlinux exists 2021-05-19 10:12:59 +02:00
.mailmap mailmap: add two more addresses of Uwe Kleine-König 2020-12-06 10:19:07 -08:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Move Jason Cooper to CREDITS 2020-11-30 10:20:34 +01:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS MAINTAINERS: adjust GCC PLUGINS after gcc-plugin.sh removal 2021-12-14 11:32:46 +01:00
Makefile Linux 5.10.105 2022-03-11 12:11:55 +01:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.