提交 db5e7a79 编写于 作者: J Jean-Philippe Brucker 提交者: Zheng Zengkai

mm: export symbol mm_access

maillist inclusion
category: feature
bugzilla: 51855
CVE: NA

Reference: https://jpbrucker.net/git/linux/commit/?h=sva/2021-03-01&id=17c99c238dbfb453256f2a85a9f0c48dbc976814

---------------------------------------------

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.
Signed-off-by: NJean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: NLijun Fang <fanglijun3@huawei.com>
Reviewed-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 7ca84842
......@@ -1225,6 +1225,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 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;
......@@ -1244,6 +1257,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.
先完成此消息的编辑!
想要评论请 注册