<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/misc/uacce, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-01-16T15:43:17+00:00</updated>
<entry>
<title>uacce: ensure safe queue release with state management</title>
<updated>2026-01-16T15:43:17+00:00</updated>
<author>
<name>Chenghai Huang</name>
<email>huangchenghai2@huawei.com</email>
</author>
<published>2025-12-02T06:12:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=26c08dabe5475d99a13f353d8dd70e518de45663'/>
<id>urn:sha1:26c08dabe5475d99a13f353d8dd70e518de45663</id>
<content type='text'>
Directly calling `put_queue` carries risks since it cannot
guarantee that resources of `uacce_queue` have been fully released
beforehand. So adding a `stop_queue` operation for the
UACCE_CMD_PUT_Q command and leaving the `put_queue` operation to
the final resource release ensures safety.

Queue states are defined as follows:
- UACCE_Q_ZOMBIE: Initial state
- UACCE_Q_INIT: After opening `uacce`
- UACCE_Q_STARTED: After `start` is issued via `ioctl`

When executing `poweroff -f` in virt while accelerator are still
working, `uacce_fops_release` and `uacce_remove` may execute
concurrently. This can cause `uacce_put_queue` within
`uacce_fops_release` to access a NULL `ops` pointer. Therefore, add
state checks to prevent accessing freed pointers.

Fixes: 015d239ac014 ("uacce: add uacce driver")
Cc: stable@vger.kernel.org
Signed-off-by: Chenghai Huang &lt;huangchenghai2@huawei.com&gt;
Signed-off-by: Yang Shen &lt;shenyang39@huawei.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Link: https://patch.msgid.link/20251202061256.4158641-5-huangchenghai2@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uacce: implement mremap in uacce_vm_ops to return -EPERM</title>
<updated>2026-01-16T15:43:16+00:00</updated>
<author>
<name>Yang Shen</name>
<email>shenyang39@huawei.com</email>
</author>
<published>2025-12-02T06:12:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=02695347be532b628f22488300d40c4eba48b9b7'/>
<id>urn:sha1:02695347be532b628f22488300d40c4eba48b9b7</id>
<content type='text'>
The current uacce_vm_ops does not support the mremap operation of
vm_operations_struct. Implement .mremap to return -EPERM to remind
users.

The reason we need to explicitly disable mremap is that when the
driver does not implement .mremap, it uses the default mremap
method. This could lead to a risk scenario:

An application might first mmap address p1, then mremap to p2,
followed by munmap(p1), and finally munmap(p2). Since the default
mremap copies the original vma's vm_private_data (i.e., q) to the
new vma, both munmap operations would trigger vma_close, causing
q-&gt;qfr to be freed twice(qfr will be set to null here, so repeated
release is ok).

Fixes: 015d239ac014 ("uacce: add uacce driver")
Cc: stable@vger.kernel.org
Signed-off-by: Yang Shen &lt;shenyang39@huawei.com&gt;
Signed-off-by: Chenghai Huang &lt;huangchenghai2@huawei.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Link: https://patch.msgid.link/20251202061256.4158641-4-huangchenghai2@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uacce: fix isolate sysfs check condition</title>
<updated>2026-01-16T15:43:16+00:00</updated>
<author>
<name>Chenghai Huang</name>
<email>huangchenghai2@huawei.com</email>
</author>
<published>2025-12-02T06:12:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=98eec349259b1fd876f350b1c600403bcef8f85d'/>
<id>urn:sha1:98eec349259b1fd876f350b1c600403bcef8f85d</id>
<content type='text'>
uacce supports the device isolation feature. If the driver
implements the isolate_err_threshold_read and
isolate_err_threshold_write callback functions, uacce will create
sysfs files now. Users can read and configure the isolation policy
through sysfs. Currently, sysfs files are created as long as either
isolate_err_threshold_read or isolate_err_threshold_write callback
functions are present.

However, accessing a non-existent callback function may cause the
system to crash. Therefore, intercept the creation of sysfs if
neither read nor write exists; create sysfs if either is supported,
but intercept unsupported operations at the call site.

Fixes: e3e289fbc0b5 ("uacce: supports device isolation feature")
Cc: stable@vger.kernel.org
Signed-off-by: Chenghai Huang &lt;huangchenghai2@huawei.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Link: https://patch.msgid.link/20251202061256.4158641-3-huangchenghai2@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uacce: fix cdev handling in the cleanup path</title>
<updated>2026-01-16T15:43:16+00:00</updated>
<author>
<name>Wenkai Lin</name>
<email>linwenkai6@hisilicon.com</email>
</author>
<published>2025-12-02T06:12:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a3bece3678f6c88db1f44c602b2a63e84b4040ac'/>
<id>urn:sha1:a3bece3678f6c88db1f44c602b2a63e84b4040ac</id>
<content type='text'>
When cdev_device_add fails, it internally releases the cdev memory,
and if cdev_device_del is then executed, it will cause a hang error.
To fix it, we check the return value of cdev_device_add() and clear
uacce-&gt;cdev to avoid calling cdev_device_del in the uacce_remove.

Fixes: 015d239ac014 ("uacce: add uacce driver")
Cc: stable@vger.kernel.org
Signed-off-by: Wenkai Lin &lt;linwenkai6@hisilicon.com&gt;
Signed-off-by: Chenghai Huang &lt;huangchenghai2@huawei.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Link: https://patch.msgid.link/20251202061256.4158641-2-huangchenghai2@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uacce: Remove unnecessary IOMMU_DEV_FEAT_IOPF</title>
<updated>2025-04-28T11:04:34+00:00</updated>
<author>
<name>Lu Baolu</name>
<email>baolu.lu@linux.intel.com</email>
</author>
<published>2025-04-18T08:01:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ec027bf7e889845dd6119132cc672a6f6aa0337f'/>
<id>urn:sha1:ec027bf7e889845dd6119132cc672a6f6aa0337f</id>
<content type='text'>
None of the drivers implement anything for IOMMU_DEV_FEAT_IOPF anymore,
remove it to avoid dead code.

Signed-off-by: Lu Baolu &lt;baolu.lu@linux.intel.com&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Reviewed-by: Kevin Tian &lt;kevin.tian@intel.com&gt;
Acked-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Tested-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Link: https://lore.kernel.org/r/20250418080130.1844424-7-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
<entry>
<title>iommu: Remove IOMMU_DEV_FEAT_SVA</title>
<updated>2025-04-28T11:04:29+00:00</updated>
<author>
<name>Jason Gunthorpe</name>
<email>jgg@nvidia.com</email>
</author>
<published>2025-04-18T08:01:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7c8896dd4a2a27c84b04dcf0990e6f6b118cb6b2'/>
<id>urn:sha1:7c8896dd4a2a27c84b04dcf0990e6f6b118cb6b2</id>
<content type='text'>
None of the drivers implement anything here anymore, remove the dead code.

Signed-off-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Signed-off-by: Lu Baolu &lt;baolu.lu@linux.intel.com&gt;
Reviewed-by: Kevin Tian &lt;kevin.tian@intel.com&gt;
Reviewed-by: Yi Liu &lt;yi.l.liu@intel.com&gt;
Tested-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Link: https://lore.kernel.org/r/20250418080130.1844424-3-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
<entry>
<title>uacce: make uacce_class constant</title>
<updated>2023-10-27T06:51:00+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2023-10-24T11:49:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=40ea89fb19fdb73472f63a4b00c728ebb55af1b5'/>
<id>urn:sha1:40ea89fb19fdb73472f63a4b00c728ebb55af1b5</id>
<content type='text'>
Now that the driver core allows for struct class to be in read-only
memory, we should make all 'class' structures declared at build time
placing them into read-only memory, instead of having to be dynamically
allocated at runtime.

Cc: Zhou Wang &lt;wangzhou1@hisilicon.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: linux-accelerators@lists.ozlabs.org
Tested-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Link: https://lore.kernel.org/r/2023102458-designate-vicinity-4c86@gregkh
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uacce: vma_close clears q-&gt;qfrs when freeing qfrs</title>
<updated>2023-05-31T18:00:26+00:00</updated>
<author>
<name>Zhangfei Gao</name>
<email>zhangfei.gao@linaro.org</email>
</author>
<published>2023-05-11T09:59:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=282c22a8bbeabd272c048ae243238638c9b7cefe'/>
<id>urn:sha1:282c22a8bbeabd272c048ae243238638c9b7cefe</id>
<content type='text'>
vma_close frees qfrs but not clears q-&gt;qfrs, which still points
to the freed object, leading to subsequent mmap fail.
So vma_close clears q-&gt;qfrs as well.

Suggested-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Link: https://lore.kernel.org/r/20230511095921.9331-3-zhangfei.gao@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uacce: use q-&gt;mapping to replace inode-&gt;i_mapping</title>
<updated>2023-05-31T18:00:26+00:00</updated>
<author>
<name>Zhangfei Gao</name>
<email>zhangfei.gao@linaro.org</email>
</author>
<published>2023-05-11T09:59:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=df1b056d489d98c7c45fa89627102dd34b44496f'/>
<id>urn:sha1:df1b056d489d98c7c45fa89627102dd34b44496f</id>
<content type='text'>
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-&gt;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-&gt;mapping to replace uacce-&gt;inode-&gt;i_mapping.

Signed-off-by: Weili Qian &lt;qianweili@huawei.com&gt;
Signed-off-by: Zhangfei Gao &lt;zhangfei.gao@linaro.org&gt;
Link: https://lore.kernel.org/r/20230511095921.9331-2-zhangfei.gao@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: class: remove module * from class_create()</title>
<updated>2023-03-17T14:16:33+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2023-03-13T18:18:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1aaba11da9aa7d7d6b52a74d45b31cac118295a1'/>
<id>urn:sha1:1aaba11da9aa7d7d6b52a74d45b31cac118295a1</id>
<content type='text'>
The module pointer in class_create() never actually did anything, and it
shouldn't have been requred to be set as a parameter even if it did
something.  So just remove it and fix up all callers of the function in
the kernel tree at the same time.

Cc: "Rafael J. Wysocki" &lt;rafael@kernel.org&gt;
Acked-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Link: https://lore.kernel.org/r/20230313181843.1207845-4-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
