Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit f08cae2f authored by Boyang Zhou's avatar Boyang Zhou Committed by Will Deacon
Browse files

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: default avatarBoyang Zhou <zhouby_cn@126.com>
[will: rewrote commit message]
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent bc15cf70
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment