Commit aa609da5 authored by Zhangfei Gao's avatar Zhangfei Gao Committed by JiangShui
Browse files

uacce: use q->mapping to replace inode->i_mapping

mainline inclusion
from mainline-v6.5-rc1
commit df1b056d
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I87RJC
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=df1b056d489d98c7c45fa89627102dd34b44496f



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

The inode can be different in a container, for example, a docker and host
both open the same uacce parent device, which uses the same uacce struct
but different inode, so uacce->inode is not enough.

What's worse, when docker stops, the inode will be destroyed as well,
causing use-after-free in uacce_remove.

So use q->mapping to replace uacce->inode->i_mapping.

Signed-off-by: default avatarWeili Qian <qianweili@huawei.com>
Signed-off-by: default avatarZhangfei Gao <zhangfei.gao@linaro.org>
Link: https://lore.kernel.org/r/20230511095921.9331-2-zhangfei.gao@linaro.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJiangShui Yang <yangjiangshui@h-partners.com>
parent df86cdc5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment