Re: [PATCH] uacce: unmap remaining mmapping from user space

2020-02-25 Thread Xu Zaibo
Hi, On 2020/2/25 16:33, zhangfei wrote: Hi, Zaibo On 2020/2/24 下午3:17, Xu Zaibo wrote: @@ -585,6 +595,13 @@ void uacce_remove(struct uacce_device *uacce) cdev_device_del(uacce->cdev, >dev); xa_erase(_xa, uacce->dev_id); put_device(>dev); + +/* + * unmap

Re: [PATCH] uacce: unmap remaining mmapping from user space

2020-02-25 Thread zhangfei
Hi, Zaibo On 2020/2/24 下午3:17, Xu Zaibo wrote:   @@ -585,6 +595,13 @@ void uacce_remove(struct uacce_device *uacce)   cdev_device_del(uacce->cdev, >dev);   xa_erase(_xa, uacce->dev_id);   put_device(>dev); + +    /* + * unmap remainning mapping from user space, preventing

Re: [PATCH] uacce: unmap remaining mmapping from user space

2020-02-23 Thread Xu Zaibo
Hi Zhangfei, On 2020/2/24 15:06, Zhangfei Gao wrote: When uacce parent device module is removed, user app may still keep the mmaped area, which can be accessed unsafely. When rmmod, Parent device drvier will call uacce_remove, which unmap all remaining mapping from user space for safety.

[PATCH] uacce: unmap remaining mmapping from user space

2020-02-23 Thread Zhangfei Gao
When uacce parent device module is removed, user app may still keep the mmaped area, which can be accessed unsafely. When rmmod, Parent device drvier will call uacce_remove, which unmap all remaining mapping from user space for safety. VM_FAULT_SIGBUS is also reported to user space accordingly.