summaryrefslogtreecommitdiff
path: root/proto_ethernet.c
AgeCommit message (Expand)AuthorFilesLines
2013-03-15all: import netsniff-ng 0.5.8-rc0 sourceDaniel Borkmann1-0/+80
load'/>
authorWill Deacon <will.deacon@arm.com>2016-07-04 16:59:43 +0100
committerWill Deacon <will.deacon@arm.com>2016-10-19 15:37:23 +0100
commit1c5b51dfb7b4564008e0cadec5381a69e88b0d21 (patch)
treeccad07a3c552411526092333e165cca761df701c
parent91cb163e4d141c74e99639fbee7c2a6332c92901 (diff)
arm64: swp emulation: bound LL/SC retries before rescheduling
If a CPU does not implement a global monitor for certain memory types, then userspace can attempt a kernel DoS by issuing SWP instructions targetting the problematic memory (for example, a framebuffer mapped with non-cacheable attributes). The SWP emulation code protects against these sorts of attacks by checking for pending signals and potentially rescheduling when the STXR instruction fails during the emulation. Whilst this is good for avoiding livelock, it harms emulation of legitimate SWP instructions on CPUs where forward progress is not guaranteed if there are memory accesses to the same reservation granule (up to 2k) between the failing STXR and the retry of the LDXR. This patch solves the problem by retrying the STXR a bounded number of times (4) before breaking out of the LL/SC loop and looking for something else to do. Cc: <stable@vger.kernel.org> Fixes: bd35a4adc413 ("arm64: Port SWP/SWPB emulation support from arm") Reviewed-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat