Until this commit the mainline kernel version (this version) of the
vboxguest module contained a bug where it defined
VBGL_IOCTL_VMMDEV_REQUEST_BIG and VBGL_IOCTL_LOG using
_IOC(_IOC_READ | _IOC_WRITE, 'V', ...) instead of
_IO(V, ...) as the out of tree VirtualBox upstream version does.
Since the VirtualBox userspace bits are always built against VirtualBox
upstream's headers, this means that so far the mainline kernel version
of the vboxguest module has been failing these 2 ioctls with -ENOTTY.
I guess that VBGL_IOCTL_VMMDEV_REQUEST_BIG is never used causing us to
not hit that one and sofar the vboxguest driver has failed to actually
log any log messages passed it through VBGL_IOCTL_LOG.
This commit changes the VBGL_IOCTL_VMMDEV_REQUEST_BIG and VBGL_IOCTL_LOG
defines to match the out of tree VirtualBox upstream vboxguest version,
while keeping compatibility with the old wrong request defines so as
to not break the kernel ABI in case someone has been using the old
request defines.
Fixes: f6ddd094f579 ("virt: Add vboxguest driver for Virtual Box Guest integration UAPI")
Cc: stable(a)vger.kernel.org
Acked-by: Arnd Bergmann <arnd(a)arndb.de>
Reviewed-by: Arnd Bergmann <arnd(a)arndb.de>
Signed-off-by: Hans de Goede <hdegoede(a)redhat.com>
---
drivers/virt/vboxguest/vboxguest_core.c | 4 +++-
drivers/virt/vboxguest/vboxguest_core.h | 15 +++++++++++++++
drivers/virt/vboxguest/vboxguest_linux.c | 3 ++-
include/uapi/linux/vboxguest.h | 4 ++--
4 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
index b690a8a4bf9e..8fab04e76c14 100644
--- a/drivers/virt/vboxguest/vboxguest_core.c
+++ b/drivers/virt/vboxguest/vboxguest_core.c
@@ -1520,7 +1520,8 @@ int vbg_core_ioctl(struct vbg_session *session, unsigned int req, void *data)
/* For VMMDEV_REQUEST hdr->type != VBG_IOCTL_HDR_TYPE_DEFAULT */
if (req_no_size == VBG_IOCTL_VMMDEV_REQUEST(0) ||
- req == VBG_IOCTL_VMMDEV_REQUEST_BIG)
+ req == VBG_IOCTL_VMMDEV_REQUEST_BIG ||
+ req == VBG_IOCTL_VMMDEV_REQUEST_BIG_ALT)
return vbg_ioctl_vmmrequest(gdev, session, data);
if (hdr->type != VBG_IOCTL_HDR_TYPE_DEFAULT)
@@ -1558,6 +1559,7 @@ int vbg_core_ioctl(struct vbg_session *session, unsigned int req, void *data)
case VBG_IOCTL_HGCM_CALL(0):
return vbg_ioctl_hgcm_call(gdev, session, f32bit, data);
case VBG_IOCTL_LOG(0):
+ case VBG_IOCTL_LOG_ALT(0):
return vbg_ioctl_log(data);
}
diff --git a/drivers/virt/vboxguest/vboxguest_core.h b/drivers/virt/vboxguest/vboxguest_core.h
index 4188c12b839f..77c3a9c8255d 100644
--- a/drivers/virt/vboxguest/vboxguest_core.h
+++ b/drivers/virt/vboxguest/vboxguest_core.h
@@ -15,6 +15,21 @@
#include <linux/vboxguest.h>
#include "vmmdev.h"
+/*
+ * The mainline kernel version (this version) of the vboxguest module
+ * contained a bug where it defined VBGL_IOCTL_VMMDEV_REQUEST_BIG and
+ * VBGL_IOCTL_LOG using _IOC(_IOC_READ | _IOC_WRITE, 'V', ...) instead
+ * of _IO(V, ...) as the out of tree VirtualBox upstream version does.
+ *
+ * These _ALT definitions keep compatibility with the wrong defines the
+ * mainline kernel version used for a while.
+ * Note the VirtualBox userspace bits have always been built against
+ * VirtualBox upstream's headers, so this is likely not necessary. But
+ * we must never break our ABI so we keep these around to be 100% sure.
+ */
+#define VBG_IOCTL_VMMDEV_REQUEST_BIG_ALT _IOC(_IOC_READ | _IOC_WRITE, 'V', 3, 0)
+#define VBG_IOCTL_LOG_ALT(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 9, s)
+
struct vbg_session;
/** VBox guest memory balloon. */
diff --git a/drivers/virt/vboxguest/vboxguest_linux.c b/drivers/virt/vboxguest/vboxguest_linux.c
index 6e8c0f1c1056..32c2c52f7e84 100644
--- a/drivers/virt/vboxguest/vboxguest_linux.c
+++ b/drivers/virt/vboxguest/vboxguest_linux.c
@@ -131,7 +131,8 @@ static long vbg_misc_device_ioctl(struct file *filp, unsigned int req,
* the need for a bounce-buffer and another copy later on.
*/
is_vmmdev_req = (req & ~IOCSIZE_MASK) == VBG_IOCTL_VMMDEV_REQUEST(0) ||
- req == VBG_IOCTL_VMMDEV_REQUEST_BIG;
+ req == VBG_IOCTL_VMMDEV_REQUEST_BIG ||
+ req == VBG_IOCTL_VMMDEV_REQUEST_BIG_ALT;
if (is_vmmdev_req)
buf = vbg_req_alloc(size, VBG_IOCTL_HDR_TYPE_DEFAULT,
diff --git a/include/uapi/linux/vboxguest.h b/include/uapi/linux/vboxguest.h
index 9cec58a6a5ea..f79d7abe27db 100644
--- a/include/uapi/linux/vboxguest.h
+++ b/include/uapi/linux/vboxguest.h
@@ -103,7 +103,7 @@ VMMDEV_ASSERT_SIZE(vbg_ioctl_driver_version_info, 24 + 20);
/* IOCTL to perform a VMM Device request larger then 1KB. */
-#define VBG_IOCTL_VMMDEV_REQUEST_BIG _IOC(_IOC_READ | _IOC_WRITE, 'V', 3, 0)
+#define VBG_IOCTL_VMMDEV_REQUEST_BIG _IO('V', 3)
/** VBG_IOCTL_HGCM_CONNECT data structure. */
@@ -198,7 +198,7 @@ struct vbg_ioctl_log {
} u;
};
-#define VBG_IOCTL_LOG(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 9, s)
+#define VBG_IOCTL_LOG(s) _IO('V', 9)
/** VBG_IOCTL_WAIT_FOR_EVENTS data structure. */
--
2.26.2
This is the start of the stable review cycle for the 5.4.51 release.
There are 65 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Thu, 09 Jul 2020 14:57:34 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.51-rc1…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.4.51-rc1
Peter Jones <pjones(a)redhat.com>
efi: Make it possible to disable efivar_ssdt entirely
Hou Tao <houtao1(a)huawei.com>
dm zoned: assign max_io_len correctly
Babu Moger <babu.moger(a)amd.com>
x86/resctrl: Fix memory bandwidth counter width for AMD
Vlastimil Babka <vbabka(a)suse.cz>
mm, compaction: make capture control handling safe wrt interrupts
Vlastimil Babka <vbabka(a)suse.cz>
mm, compaction: fully assume capture is not NULL in compact_zone_order()
Marc Zyngier <maz(a)kernel.org>
irqchip/gic: Atomically update affinity
Sumit Semwal <sumit.semwal(a)linaro.org>
dma-buf: Move dma_buf_release() from fops to dentry_ops
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu/atomfirmware: fix vram_info fetching for renoir
Alex Deucher <alexander.deucher(a)amd.com>
drm/amdgpu: use %u rather than %d for sclk/mclk
Nicholas Kazlauskas <nicholas.kazlauskas(a)amd.com>
drm/amd/display: Only revalidate bandwidth on medium and fast updates
Hauke Mehrtens <hauke(a)hauke-m.de>
MIPS: Add missing EHB in mtc0 -> mfc0 sequence for DSPen
Martin Blumenstingl <martin.blumenstingl(a)googlemail.com>
MIPS: lantiq: xway: sysctrl: fix the GPHY clock alias names
Zhang Xiaoxu <zhangxiaoxu5(a)huawei.com>
cifs: Fix the target file was deleted when rename failed.
Paul Aurich <paul(a)darkrain42.org>
SMB3: Honor 'handletimeout' flag for multiuser mounts
Paul Aurich <paul(a)darkrain42.org>
SMB3: Honor lease disabling for multiuser mounts
Paul Aurich <paul(a)darkrain42.org>
SMB3: Honor persistent/resilient handle flags for multiuser mounts
Paul Aurich <paul(a)darkrain42.org>
SMB3: Honor 'seal' flag for multiuser mounts
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "ALSA: usb-audio: Improve frames size computation"
J. Bruce Fields <bfields(a)redhat.com>
nfsd: apply umask on fs without ACL support
Krzysztof Kozlowski <krzk(a)kernel.org>
spi: spi-fsl-dspi: Fix external abort on interrupt in resume or exit paths
Wolfram Sang <wsa+renesas(a)sang-engineering.com>
i2c: mlxcpld: check correct size of maximum RECV_LEN packet
Chris Packham <chris.packham(a)alliedtelesis.co.nz>
i2c: algo-pca: Add 0x78 as SCL stuck low status for PCA9665
Kees Cook <keescook(a)chromium.org>
samples/vfs: avoid warning in statx override
Christoph Hellwig <hch(a)lst.de>
nvme: fix a crash in nvme_mpath_add_disk
Sagi Grimberg <sagi(a)grimberg.me>
nvme: fix identify error status silent ignore
Paul Aurich <paul(a)darkrain42.org>
SMB3: Honor 'posix' flag for multiuser mounts
Hou Tao <houtao1(a)huawei.com>
virtio-blk: free vblk-vqs in error path of virtblk_probe()
Chen-Yu Tsai <wens(a)csie.org>
drm: sun4i: hdmi: Remove extra HPD polling
J. Bruce Fields <bfields(a)redhat.com>
nfsd: fix nfsdfs inode reference count leak
J. Bruce Fields <bfields(a)redhat.com>
nfsd4: fix nfsdfs reference count loop
J. Bruce Fields <bfields(a)redhat.com>
nfsd: clients don't need to break their own delegations
J. Bruce Fields <bfields(a)redhat.com>
kthread: save thread function
Dien Pham <dien.pham.ry(a)renesas.com>
thermal/drivers/rcar_gen3: Fix undefined temperature if negative
Michael Kao <michael.kao(a)mediatek.com>
thermal/drivers/mediatek: Fix bank number settings on mt8183
Misono Tomohiro <misono.tomohiro(a)jp.fujitsu.com>
hwmon: (acpi_power_meter) Fix potential memory leak in acpi_power_meter_add()
Chu Lin <linchuyuan(a)google.com>
hwmon: (max6697) Make sure the OVERT mask is set correctly
Rahul Lakkireddy <rahul.lakkireddy(a)chelsio.com>
cxgb4: fix SGE queue dump destination buffer context
Rahul Lakkireddy <rahul.lakkireddy(a)chelsio.com>
cxgb4: use correct type for all-mask IP address comparison
Rahul Lakkireddy <rahul.lakkireddy(a)chelsio.com>
cxgb4: fix endian conversions for L4 ports in filters
Rahul Lakkireddy <rahul.lakkireddy(a)chelsio.com>
cxgb4: parse TC-U32 key values and masks natively
Rahul Lakkireddy <rahul.lakkireddy(a)chelsio.com>
cxgb4: use unaligned conversion for fetching timestamp
Mark Zhang <markz(a)mellanox.com>
RDMA/counter: Query a counter before release
David Howells <dhowells(a)redhat.com>
rxrpc: Fix afs large storage transmission performance drop
Chen Tao <chentao107(a)huawei.com>
drm/msm/dpu: fix error return code in dpu_encoder_init
Herbert Xu <herbert(a)gondor.apana.org.au>
crypto: af_alg - fix use-after-free in af_alg_accept() due to bh_lock_sock()
James Bottomley <James.Bottomley(a)HansenPartnership.com>
tpm: Fix TIS locality timeout problems
Jarkko Sakkinen <jarkko.sakkinen(a)linux.intel.com>
selftests: tpm: Use /bin/sh instead of /bin/bash
Douglas Anderson <dianders(a)chromium.org>
kgdb: Avoid suspicious RCU usage warning
Sagi Grimberg <sagi(a)grimberg.me>
nvme-multipath: fix bogus request queue reference put
Anton Eidelman <anton(a)lightbitslabs.com>
nvme-multipath: fix deadlock due to head->lock
Anton Eidelman <anton(a)lightbitslabs.com>
nvme-multipath: fix deadlock between ana_work and scan_work
Sagi Grimberg <sagi(a)grimberg.me>
nvme: fix possible deadlock when I/O is blocked
Keith Busch <kbusch(a)kernel.org>
nvme-multipath: set bdi capabilities once
Christian Borntraeger <borntraeger(a)de.ibm.com>
s390/debug: avoid kernel warning on too large number of pages
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tools lib traceevent: Handle __attribute__((user)) in field names
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tools lib traceevent: Add append() function helper for appending strings
Zqiang <qiang.zhang(a)windriver.com>
usb: usbtest: fix missing kfree(dev->buf) in usbtest_disconnect
David Howells <dhowells(a)redhat.com>
rxrpc: Fix race between incoming ACK parser and retransmitter
Qian Cai <cai(a)lca.pw>
mm/slub: fix stack overruns with SLUB_STATS
Dongli Zhang <dongli.zhang(a)oracle.com>
mm/slub.c: fix corrupted freechain in deactivate_slab()
Valentin Schneider <valentin.schneider(a)arm.com>
sched/debug: Make sd->flags sysctl read-only
Tuomas Tynkkynen <tuomas.tynkkynen(a)iki.fi>
usbnet: smsc95xx: Fix use-after-free after removal
Borislav Petkov <bp(a)suse.de>
EDAC/amd64: Read back the scrub rate PCI register on F15h
Hugh Dickins <hughd(a)google.com>
mm: fix swap cache node allocation mask
Jens Axboe <axboe(a)kernel.dk>
io_uring: make sure async workqueue is canceled on exit
-------------
Diffstat:
Documentation/filesystems/locking.rst | 2 +
Makefile | 4 +-
arch/mips/kernel/traps.c | 1 +
arch/mips/lantiq/xway/sysctrl.c | 8 +-
arch/s390/kernel/debug.c | 3 +-
arch/x86/kernel/cpu/resctrl/core.c | 2 +
arch/x86/kernel/cpu/resctrl/internal.h | 3 +
arch/x86/kernel/cpu/resctrl/monitor.c | 3 +-
crypto/af_alg.c | 26 ++--
crypto/algif_aead.c | 9 +-
crypto/algif_hash.c | 9 +-
crypto/algif_skcipher.c | 9 +-
drivers/block/virtio_blk.c | 1 +
drivers/char/tpm/tpm-dev-common.c | 19 ++-
drivers/dma-buf/dma-buf.c | 54 ++++-----
drivers/edac/amd64_edac.c | 2 +
drivers/firmware/efi/Kconfig | 11 ++
drivers/firmware/efi/efi.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 4 +-
drivers/gpu/drm/amd/display/dc/core/dc.c | 10 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 +-
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 5 +-
drivers/hwmon/acpi_power_meter.c | 4 +-
drivers/hwmon/max6697.c | 7 +-
drivers/i2c/algos/i2c-algo-pca.c | 3 +-
drivers/i2c/busses/i2c-mlxcpld.c | 4 +-
drivers/infiniband/core/counters.c | 4 +-
drivers/irqchip/irq-gic.c | 14 +--
drivers/md/dm-zoned-target.c | 2 +-
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 6 +-
drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 25 ++--
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +-
.../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 30 ++---
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c | 18 +--
.../ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h | 122 ++++++++++++-------
drivers/net/ethernet/chelsio/cxgb4/sge.c | 2 +-
drivers/net/usb/smsc95xx.c | 2 +-
drivers/nvme/host/core.c | 13 +-
drivers/nvme/host/multipath.c | 45 +++++--
drivers/nvme/host/nvme.h | 2 +
drivers/spi/spi-fsl-dspi.c | 17 ++-
drivers/thermal/mtk_thermal.c | 5 +-
drivers/thermal/rcar_gen3_thermal.c | 2 +-
drivers/usb/misc/usbtest.c | 1 +
fs/cifs/connect.c | 10 +-
fs/cifs/inode.c | 10 +-
fs/io_uring.c | 63 ++++++++++
fs/locks.c | 3 +
fs/nfsd/nfs4proc.c | 2 +
fs/nfsd/nfs4state.c | 22 +++-
fs/nfsd/nfsctl.c | 23 ++--
fs/nfsd/nfsd.h | 5 +
fs/nfsd/nfssvc.c | 6 +
fs/nfsd/vfs.c | 6 +
include/crypto/if_alg.h | 4 +-
include/linux/fs.h | 1 +
include/linux/kthread.h | 1 +
include/linux/sunrpc/svc.h | 1 +
kernel/debug/debug_core.c | 4 +
kernel/kthread.c | 17 +++
kernel/sched/debug.c | 2 +-
mm/compaction.c | 19 ++-
mm/slub.c | 30 ++++-
mm/swap_state.c | 4 +-
net/rxrpc/call_event.c | 29 ++---
samples/vfs/test-statx.c | 2 +
sound/usb/card.h | 4 -
sound/usb/endpoint.c | 43 +------
sound/usb/endpoint.h | 1 -
sound/usb/pcm.c | 2 -
tools/lib/traceevent/event-parse.c | 133 ++++++++++++---------
tools/testing/selftests/tpm2/test_smoke.sh | 2 +-
tools/testing/selftests/tpm2/test_space.sh | 2 +-
74 files changed, 609 insertions(+), 362 deletions(-)