diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-08-28 13:35:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-07 21:58:15 -0700 |
commit | 52b331e9991f5639e8888349eccc02dd2986b51c (patch) | |
tree | f6d0e3c3c774c60007f80fcf762076beb7d63aca /lib/flex_array.c | |
parent | 5817e3c7a152e2febbb342a807487e739395a973 (diff) |
SUNRPC: Fix memory corruption issue on 32-bit highmem systems
commit 347e2233b7667e336d9f671f1a52dfa3f0416e2c upstream.
Some architectures, such as ARM-32 do not return the same base address
when you call kmap_atomic() twice on the same page.
This causes problems for the memmove() call in the XDR helper routine
"_shift_data_right_pages()", since it defeats the detection of
overlapping memory ranges, and has been seen to corrupt memory.
The fix is to distinguish between the case where we're doing an
inter-page copy or not. In the former case of we know that the memory
ranges cannot possibly overlap, so we can additionally micro-optimise
by replacing memmove() with memcpy().
Reported-by: Mark Young <MYoung@nvidia.com>
Reported-by: Matt Craighead <mcraighead@nvidia.com>
Cc: Bruce Fields <bfields@fieldses.org>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Tested-by: Matt Craighead <mcraighead@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/flex_array.c')
0 files changed, 0 insertions, 0 deletions