1
0
Fork 0
alistair23-linux/arch/arm/lib
Vincent Whitchurch 344eb5539a ARM: 8813/1: Make aligned 2-byte getuser()/putuser() atomic on ARMv6+
getuser() and putuser() (and there underscored variants) use two
strb[t]/ldrb[t] instructions when they are asked to get/put 16-bits.
This means that the read/write is not atomic even when performed to a
16-bit-aligned address.

This leads to problems with vhost: vhost uses __getuser() to read the
vring's 16-bit avail.index field, and if it happens to observe a partial
update of the index, wrong descriptors will be used which will lead to a
breakdown of the virtio communication.  A similar problem exists for
__putuser() which is used to write to the vring's used.index field.

The reason these functions use strb[t]/ldrb[t] is because strht/ldrht
instructions did not exist until ARMv6T2/ARMv7.  So we should be easily
able to fix this on ARMv7.  Also, since all ARMv6 processors also don't
actually use the unprivileged instructions anymore for uaccess (since
CONFIG_CPU_USE_DOMAINS is not used) we can easily fix them too.

Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2018-11-12 10:52:04 +00:00
..
Makefile ARM: 8745/1: get rid of __memzero() 2018-01-21 15:37:56 +00:00
ashldi3.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
ashrdi3.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
backtrace.S ARM: fix backtrace 2016-11-15 15:25:39 +00:00
bitops.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bswapsdi2.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
call_with_stack.S ARM: replace BSYM() with badr assembly macro 2015-05-08 17:33:50 +01:00
changebit.S ARM: 7171/1: unwind: add unwind directives to bitops assembly macros 2011-11-26 21:58:53 +00:00
clear_user.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
clearbit.S ARM: 7171/1: unwind: add unwind directives to bitops assembly macros 2011-11-26 21:58:53 +00:00
copy_from_user.S ARM: 8812/1: Optimise copy_{from/to}_user for !CPU_USE_DOMAINS 2018-11-12 10:51:59 +00:00
copy_page.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
copy_template.S ARM: 8225/1: Add unwinding support for memory copy functions 2014-11-27 16:00:25 +00:00
copy_to_user.S ARM: 8812/1: Optimise copy_{from/to}_user for !CPU_USE_DOMAINS 2018-11-12 10:51:59 +00:00
csumipv6.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
csumpartial.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
csumpartialcopy.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
csumpartialcopygeneric.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
csumpartialcopyuser.S ARM: 8731/1: Fix csum_partial_copy_from_user() stack mismatch 2017-12-17 22:20:39 +00:00
delay-loop.S ARM: 8619/1: udelay: document the various constants 2016-10-19 10:52:36 +01:00
delay.c Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
div64.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
ecard.S ARM: remove unnecessary mach/hardware.h includes 2011-07-12 11:19:27 -05:00
findbit.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
floppydma.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
getuser.S ARM: 8813/1: Make aligned 2-byte getuser()/putuser() atomic on ARMv6+ 2018-11-12 10:52:04 +00:00
io-acorn.S arch: remove direct definitions of KERN_<LEVEL> uses 2012-07-30 17:25:13 -07:00
io-readsb.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
io-readsl.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
io-readsw-armv3.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
io-readsw-armv4.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
io-writesb.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
io-writesl.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
io-writesw-armv3.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
io-writesw-armv4.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
lib1funcs.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
lshrdi3.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
memchr.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
memcpy.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
memmove.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
memset.S ARM: implement memset32 & memset64 2017-09-08 18:26:48 -07:00
muldi3.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
putuser.S ARM: 8813/1: Make aligned 2-byte getuser()/putuser() atomic on ARMv6+ 2018-11-12 10:52:04 +00:00
setbit.S ARM: 7171/1: unwind: add unwind directives to bitops assembly macros 2011-11-26 21:58:53 +00:00
strchr.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
strrchr.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
testchangebit.S ARM: 7171/1: unwind: add unwind directives to bitops assembly macros 2011-11-26 21:58:53 +00:00
testclearbit.S ARM: 7171/1: unwind: add unwind directives to bitops assembly macros 2011-11-26 21:58:53 +00:00
testsetbit.S ARM: 7171/1: unwind: add unwind directives to bitops assembly macros 2011-11-26 21:58:53 +00:00
uaccess_with_memcpy.c ARM: 8797/1: spectre-v1.1: harden __copy_to_user 2018-10-05 10:51:15 +01:00
ucmpdi2.S Revert "arm: move exports to definitions" 2016-11-23 10:00:03 +00:00
xor-neon.c ARM: 7835/2: fix modular build of xor_blocks() with NEON enabled 2013-09-09 15:24:47 +01:00