Files
linux/arch/arm/include/asm
Vincent Whitchurch b8252ec6dd ARM: 8813/1: Make aligned 2-byte getuser()/putuser() atomic on ARMv6+
[ Upstream commit 344eb5539a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-13 08:51:10 +01:00
..
2018-06-15 18:10:01 -03:00
2019-02-20 10:25:38 +01:00
2017-11-15 18:21:04 -08:00
2017-06-05 17:50:44 +02:00
2015-05-28 15:31:53 +02:00
2018-07-22 14:13:43 +02:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2018-04-19 13:28:51 +02:00
2018-07-09 20:29:49 +02:00
2018-05-19 11:53:46 +01:00
2013-07-08 22:08:51 +01:00
2018-05-07 07:15:41 +02:00
2018-01-21 15:37:56 +00:00
2017-11-13 01:34:49 +01:00
2016-10-19 10:18:47 +01:00
2014-03-18 16:39:40 -04:00