]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: compat: fix stxr failure case in SWP emulation
authorWill Deacon <will.deacon@arm.com>
Thu, 15 Oct 2015 12:55:53 +0000 (13:55 +0100)
committerWill Deacon <will.deacon@arm.com>
Wed, 28 Oct 2015 17:06:35 +0000 (17:06 +0000)
commitd615f86e31c20beadc4c03d7368c08b26192b03e
tree00adb17d6a4a89a8e6ff6c4479979f80171d3119
parentee80ff68445d23aeb95aea404e6ca43d90787671
arm64: compat: fix stxr failure case in SWP emulation

If the STXR instruction fails in the SWP emulation code, we leave *data
overwritten with the loaded value, therefore corrupting the data written
by a subsequent, successful attempt.

This patch re-jigs the code so that we only write back to *data once we
know that the update has happened.

Cc: <stable@vger.kernel.org>
Fixes: 118dcb3cb891 ("arm64: Port SWP/SWPB emulation support from arm")
Reported-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Reported-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/armv8_deprecated.c