提交 0e75bf54 编写于 作者: J Jean-Philippe Brucker 提交者: Xie XiuQi

mm: export symbol mm_access

hulk inclusion
category: feature
bugzilla: 14369
CVE: NA
-------------------

Some devices can access process address spaces directly. When creating
such bond, to check that a process controlling the device is allowed to
access the target address space, the device driver uses mm_access(). Since
the drivers (in this case VFIO) can be built as a module, export the
mm_access symbol.

Cc: felix.kuehling@amd.com
Cc: akpm@linux-foundation.org
Signed-off-by: NJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: NFang Lijun <fanglijun3@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Reviewed-by: NZhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 33bce9ca
......@@ -1196,6 +1196,19 @@ struct mm_struct *get_task_mm(struct task_struct *task)
}
EXPORT_SYMBOL_GPL(get_task_mm);
/**
* mm_access - check access permission to a task and and acquire a reference to
* its mm.
* @task: target task
* @mode: selects type of access and caller credentials
*
* Return the task's mm on success, or %NULL if it cannot be accessed.
*
* Check if the caller is allowed to read or write the target task's pages.
* @mode describes the access mode and credentials using ptrace access flags.
* See ptrace_may_access() for more details. On success, a reference to the mm
* is taken.
*/
struct mm_struct *mm_access(struct task_struct *task, unsigned int mode)
{
struct mm_struct *mm;
......@@ -1215,6 +1228,7 @@ struct mm_struct *mm_access(struct task_struct *task, unsigned int mode)
return mm;
}
EXPORT_SYMBOL_GPL(mm_access);
static void complete_vfork_done(struct task_struct *tsk)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册