diff options
| author | Haren Myneni <haren@linux.ibm.com> | 2025-06-10 07:42:27 +0530 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-06-27 11:07:22 +0100 |
| commit | 3c1299ac58f0f8b84dc116617b8b384ee8fc3d3c (patch) | |
| tree | 4cd1a5a024651611bae1d5b7cf64564426e14888 /arch | |
| parent | 620b77b23c41a6546e5548ffe2ea3ad71880dde4 (diff) | |
| download | linux-3c1299ac58f0f8b84dc116617b8b384ee8fc3d3c.tar.gz linux-3c1299ac58f0f8b84dc116617b8b384ee8fc3d3c.tar.bz2 linux-3c1299ac58f0f8b84dc116617b8b384ee8fc3d3c.zip | |
powerpc/vas: Return -EINVAL if the offset is non-zero in mmap()
[ Upstream commit 0d67f0dee6c9176bc09a5482dd7346e3a0f14d0b ]
The user space calls mmap() to map VAS window paste address
and the kernel returns the complete mapped page for each
window. So return -EINVAL if non-zero is passed for offset
parameter to mmap().
See Documentation/arch/powerpc/vas-api.rst for mmap()
restrictions.
Co-developed-by: Jonathan Greental <yonatan02greental@gmail.com>
Signed-off-by: Jonathan Greental <yonatan02greental@gmail.com>
Reported-by: Jonathan Greental <yonatan02greental@gmail.com>
Fixes: dda44eb29c23 ("powerpc/vas: Add VAS user space API")
Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250610021227.361980-2-maddy@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/powerpc/platforms/book3s/vas-api.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/book3s/vas-api.c b/arch/powerpc/platforms/book3s/vas-api.c index d954ddf7f059..0f73554c6ae9 100644 --- a/arch/powerpc/platforms/book3s/vas-api.c +++ b/arch/powerpc/platforms/book3s/vas-api.c @@ -521,6 +521,15 @@ static int coproc_mmap(struct file *fp, struct vm_area_struct *vma) return -EINVAL; } + /* + * Map complete page to the paste address. So the user + * space should pass 0ULL to the offset parameter. + */ + if (vma->vm_pgoff) { + pr_debug("Page offset unsupported to map paste address\n"); + return -EINVAL; + } + /* Ensure instance has an open send window */ if (!txwin) { pr_err("No send window open?\n"); |
