mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-23 07:23:12 +02:00
powerpc/vas: Return -EINVAL if the offset is non-zero in mmap()
[ Upstream commit0d67f0dee6
] 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:dda44eb29c
("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>
This commit is contained in:
parent
8635e325b8
commit
d2fc85c90b
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue
Block a user