diff options
author | Boyang Zhou <zhouby_cn@126.com> | 2019-04-29 17:27:19 +0300 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2019-04-29 17:27:41 +0300 |
commit | f08cae2f28db24d95be5204046b60618d8de4ddc (patch) | |
tree | 8942a40227b2d912769fef91957f36a269a8f3e1 /drivers/firmware | |
parent | bc15cf701fa4875d9710f16ca4d2ce25e66ce4a0 (diff) | |
download | linux-f08cae2f28db24d95be5204046b60618d8de4ddc.tar.xz |
arm64: mmap: Ensure file offset is treated as unsigned
The file offset argument to the arm64 sys_mmap() implementation is
scaled from bytes to pages by shifting right by PAGE_SHIFT.
Unfortunately, the offset is passed in as a signed 'off_t' type and
therefore large offsets (i.e. with the top bit set) are incorrectly
sign-extended by the shift. This has been observed to cause false mmap()
failures when mapping GPU doorbells on an arm64 server part.
Change the type of the file offset argument to sys_mmap() from 'off_t'
to 'unsigned long' so that the shifting scales the value as expected.
Cc: <stable@vger.kernel.org>
Signed-off-by: Boyang Zhou <zhouby_cn@126.com>
[will: rewrote commit message]
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/firmware')
0 files changed, 0 insertions, 0 deletions