linux/drivers/vhost
Michael S. Tsirkin a865e420b9 virtio: force spec specified alignment on types
The ring element addresses are passed between components with different
alignments assumptions. Thus, if guest/userspace selects a pointer and
host then gets and dereferences it, we might need to decrease the
compiler-selected alignment to prevent compiler on the host from
assuming pointer is aligned.

This actually triggers on ARM with -mabi=apcs-gnu - which is a
deprecated configuration, but it seems safer to handle this
generally.

Note that userspace that allocates the memory is actually OK and does
not need to be fixed, but userspace that gets it from guest or another
process does need to be fixed. The later doesn't generally talk to the
kernel so while it might be buggy it's not talking to the kernel in the
buggy way - it's just using the header in the buggy way - so fixing
header and asking userspace to recompile is the best we can do.

I verified that the produced kernel binary on x86 is exactly identical
before and after the change.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
2020-06-02 02:45:13 -04:00
..
iotlb.c vhost: factor out IOTLB 2020-04-01 12:06:26 -04:00
Kconfig vhost: disable for OABI 2020-04-20 10:19:22 -04:00
Makefile vhost: introduce vDPA-based backend 2020-04-02 10:41:40 -04:00
net.c vhost: Create accessors for virtqueues private_data 2020-04-16 18:31:07 -04:00
scsi.c vhost: Create accessors for virtqueues private_data 2020-04-16 18:31:07 -04:00
test.c virtio/test: fix up after IOTLB changes 2020-04-16 18:31:08 -04:00
test.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vdpa.c vhost: remove set but not used variable 'status' 2020-04-16 18:31:03 -04:00
vhost.c virtio: force spec specified alignment on types 2020-06-02 02:45:13 -04:00
vhost.h virtio: force spec specified alignment on types 2020-06-02 02:45:13 -04:00
vringh.c virtio: force spec specified alignment on types 2020-06-02 02:45:13 -04:00
vsock.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-05-06 20:53:22 -07:00