summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJohn David Anglin <dave.anglin@bell.net>2017-11-11 17:11:16 -0500
committerHelge Deller <deller@gmx.de>2017-11-17 15:27:13 +0100
commit05f016d2ca7a4fab99d5d5472168506ddf95e74f (patch)
treed020d10f9e2c17fee084cd5471c36f957ded604c /net
parentbebc6082da0a9f5d47a1ea2edc099bf671058bd4 (diff)
parisc: Fix validity check of pointer size argument in new CAS implementation
As noted by Christoph Biedl, passing a pointer size of 4 in the new CAS implementation causes a kernel crash. The attached patch corrects the off by one error in the argument validity check. In reviewing the code, I noticed that we only perform word operations with the pointer size argument. The subi instruction intentionally uses a word condition on 64-bit kernels. Nullification was used instead of a cmpib instruction as the branch should never be taken. The shlw pseudo-operation generates a depw,z instruction and it clears the target before doing a shift left word deposit. Thus, we don't need to clip the upper 32 bits of this argument on 64-bit kernels. Tested with a gcc testsuite run with a 64-bit kernel. The gcc atomic code in libgcc is the only direct user of the new CAS implementation that I am aware of. Signed-off-by: John David Anglin <dave.anglin@bell.net> Cc: stable@vger.kernel.org # 3.13+ Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions