<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/uio, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-04-11T23:23:56Z</updated>
<entry>
<title>Merge tag 'hyperv-fixes-signed-20240411' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux</title>
<updated>2024-04-11T23:23:56Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-04-11T23:23:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=52e5070f60a9a159dc4fe650408fc6ecdf7bfe51'/>
<id>urn:sha1:52e5070f60a9a159dc4fe650408fc6ecdf7bfe51</id>
<content type='text'>
Pull hyperv fixes from Wei Liu:

 - Some cosmetic changes (Erni Sri Satya Vennela, Li Zhijian)

 - Introduce hv_numa_node_to_pxm_info() (Nuno Das Neves)

 - Fix KVP daemon to handle IPv4 and IPv6 combination for keyfile format
   (Shradha Gupta)

 - Avoid freeing decrypted memory in a confidential VM (Rick Edgecombe
   and Michael Kelley)

* tag 'hyperv-fixes-signed-20240411' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
  Drivers: hv: vmbus: Don't free ring buffers that couldn't be re-encrypted
  uio_hv_generic: Don't free decrypted memory
  hv_netvsc: Don't free decrypted memory
  Drivers: hv: vmbus: Track decrypted status in vmbus_gpadl
  Drivers: hv: vmbus: Leak pages if set_memory_encrypted() fails
  hv/hv_kvp_daemon: Handle IPv4 and Ipv6 combination for keyfile format
  hv: vmbus: Convert sprintf() family to sysfs_emit() family
  mshyperv: Introduce hv_numa_node_to_pxm_info()
  x86/hyperv: Cosmetic changes for hv_apic.c
</content>
</entry>
<entry>
<title>uio_hv_generic: Don't free decrypted memory</title>
<updated>2024-04-10T21:33:32Z</updated>
<author>
<name>Rick Edgecombe</name>
<email>rick.p.edgecombe@intel.com</email>
</author>
<published>2024-03-11T16:15:57Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3d788b2fbe6a1a1a9e3db09742b90809d51638b7'/>
<id>urn:sha1:3d788b2fbe6a1a1a9e3db09742b90809d51638b7</id>
<content type='text'>
In CoCo VMs it is possible for the untrusted host to cause
set_memory_encrypted() or set_memory_decrypted() to fail such that an
error is returned and the resulting memory is shared. Callers need to
take care to handle these errors to avoid returning decrypted (shared)
memory to the page allocator, which could lead to functional or security
issues.

The VMBus device UIO driver could free decrypted/shared pages if
set_memory_decrypted() fails. Check the decrypted field in the gpadl
to decide whether to free the memory.

Signed-off-by: Rick Edgecombe &lt;rick.p.edgecombe@intel.com&gt;
Signed-off-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Kuppuswamy Sathyanarayanan &lt;sathyanarayanan.kuppuswamy@linux.intel.com&gt;
Acked-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20240311161558.1310-5-mhklinux@outlook.com
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
Message-ID: &lt;20240311161558.1310-5-mhklinux@outlook.com&gt;
</content>
</entry>
<entry>
<title>Fix build errors due to new UIO_MEM_DMA_COHERENT mess</title>
<updated>2024-03-27T16:48:47Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-03-27T16:48:47Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=498e47cd1d1f3e0a870a29d1b28093e64db52fd2'/>
<id>urn:sha1:498e47cd1d1f3e0a870a29d1b28093e64db52fd2</id>
<content type='text'>
Commit 576882ef5e7f ("uio: introduce UIO_MEM_DMA_COHERENT type")
introduced a new use-case for 'struct uio_mem' where the 'mem' field now
contains a kernel virtual address when 'memtype' is set to
UIO_MEM_DMA_COHERENT.

That in turn causes build errors, because 'mem' is of type
'phys_addr_t', and a virtual address is a pointer type.  When the code
just blindly uses cast to mix the two, it caused problems when
phys_addr_t isn't the same size as a pointer - notably on 32-bit
architectures with PHYS_ADDR_T_64BIT.

The proper thing to do would probably be to use a union member, and not
have any casts, and make the 'mem' member be a union of 'mem.physaddr'
and 'mem.vaddr', based on 'memtype'.

This is not that proper thing.  This is just fixing the ugly casts to be
even uglier, but at least not cause build errors on 32-bit platforms
with 64-bit physical addresses.

Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Fixes: 576882ef5e7f ("uio: introduce UIO_MEM_DMA_COHERENT type")
Fixes: 7722151e4651 ("uio_pruss: UIO_MEM_DMA_COHERENT conversion")
Fixes: 019947805a8d ("uio_dmem_genirq: UIO_MEM_DMA_COHERENT conversion")
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Chris Leech &lt;cleech@redhat.com&gt;
Cc: Nilesh Javali &lt;njavali@marvell.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uio_dmem_genirq: UIO_MEM_DMA_COHERENT conversion</title>
<updated>2024-03-07T21:52:59Z</updated>
<author>
<name>Chris Leech</name>
<email>cleech@redhat.com</email>
</author>
<published>2024-02-05T20:02:57Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=019947805a8d703fbb57d607187ff1148bb267ff'/>
<id>urn:sha1:019947805a8d703fbb57d607187ff1148bb267ff</id>
<content type='text'>
Conversion of this driver to use UIO_MEM_DMA_COHERENT for
dma_alloc_coherent memory instead of UIO_MEM_PHYS.

Signed-off-by: Chris Leech &lt;cleech@redhat.com&gt;
Link: https://lore.kernel.org/r/20240205200257.138376-1-cleech@redhat.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uio_pruss: UIO_MEM_DMA_COHERENT conversion</title>
<updated>2024-03-07T21:52:59Z</updated>
<author>
<name>Chris Leech</name>
<email>cleech@redhat.com</email>
</author>
<published>2024-02-01T23:33:59Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7722151e4651c973c18df0c18c015edcc7b43b25'/>
<id>urn:sha1:7722151e4651c973c18df0c18c015edcc7b43b25</id>
<content type='text'>
Conversion of this driver to use UIO_MEM_DMA_COHERENT for
dma_alloc_coherent memory instead of UIO_MEM_PHYS.

Signed-off-by: Chris Leech &lt;cleech@redhat.com&gt;
Link: https://lore.kernel.org/r/20240201233400.3394996-4-cleech@redhat.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uio: introduce UIO_MEM_DMA_COHERENT type</title>
<updated>2024-03-07T21:52:59Z</updated>
<author>
<name>Chris Leech</name>
<email>cleech@redhat.com</email>
</author>
<published>2024-02-05T20:01:37Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=576882ef5e7fce030b65c92b508a0f84ea5a81c2'/>
<id>urn:sha1:576882ef5e7fce030b65c92b508a0f84ea5a81c2</id>
<content type='text'>
Add a UIO memtype specifically for sharing dma_alloc_coherent
memory with userspace, backed by dma_mmap_coherent.

This is mainly for the bnx2/bnx2x/bnx2i "cnic" interface, although there
are a few other uio drivers which map dma_alloc_coherent memory and will
be converted to use dma_mmap_coherent as well.

Signed-off-by: Nilesh Javali &lt;njavali@marvell.com&gt;
Signed-off-by: Chris Leech &lt;cleech@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Link: https://lore.kernel.org/r/20240205200137.138302-1-cleech@redhat.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uio: Fix use-after-free in uio_open</title>
<updated>2024-01-04T16:03:47Z</updated>
<author>
<name>Guanghui Feng</name>
<email>guanghuifeng@linux.alibaba.com</email>
</author>
<published>2023-12-21T09:57:43Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0c9ae0b8605078eafc3bea053cc78791e97ba2e2'/>
<id>urn:sha1:0c9ae0b8605078eafc3bea053cc78791e97ba2e2</id>
<content type='text'>
core-1				core-2
-------------------------------------------------------
uio_unregister_device		uio_open
				idev = idr_find()
device_unregister(&amp;idev-&gt;dev)
put_device(&amp;idev-&gt;dev)
uio_device_release
				get_device(&amp;idev-&gt;dev)
kfree(idev)
uio_free_minor(minor)
				uio_release
				put_device(&amp;idev-&gt;dev)
				kfree(idev)
-------------------------------------------------------

In the core-1 uio_unregister_device(), the device_unregister will kfree
idev when the idev-&gt;dev kobject ref is 1. But after core-1
device_unregister, put_device and before doing kfree, the core-2 may
get_device. Then:
1. After core-1 kfree idev, the core-2 will do use-after-free for idev.
2. When core-2 do uio_release and put_device, the idev will be double
   freed.

To address this issue, we can get idev atomic &amp; inc idev reference with
minor_lock.

Fixes: 57c5f4df0a5a ("uio: fix crash after the device is unregistered")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Guanghui Feng &lt;guanghuifeng@linux.alibaba.com&gt;
Reviewed-by: Baolin Wang &lt;baolin.wang@linux.alibaba.com&gt;
Link: https://lore.kernel.org/r/1703152663-59949-1-git-send-email-guanghuifeng@linux.alibaba.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uio: pruss: fix missing iounmap() in pruss_probe()</title>
<updated>2023-08-22T11:41:55Z</updated>
<author>
<name>Yang Yingliang</name>
<email>yangyingliang@huawei.com</email>
</author>
<published>2023-08-08T12:38:27Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=979ca1ca1f2c87386deffbeb01767bb40448b4a1'/>
<id>urn:sha1:979ca1ca1f2c87386deffbeb01767bb40448b4a1</id>
<content type='text'>
platform_get_irq() is called after ioremap(), if it fails,
iounmap() needs be called in error the path.

Fixes: 2fd84b9b839c ("uio: pruss: fix to check return value of platform_get_irq() in pruss_probe()")
Signed-off-by: Yang Yingliang &lt;yangyingliang@huawei.com&gt;
Link: https://lore.kernel.org/r/20230808123827.560603-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uio: pruss: fix to check return value of platform_get_irq() in pruss_probe()</title>
<updated>2023-08-04T14:21:04Z</updated>
<author>
<name>Zhang Shurong</name>
<email>zhang_shurong@foxmail.com</email>
</author>
<published>2023-07-22T15:29:51Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2fd84b9b839c3541815733701a06d9df48297a91'/>
<id>urn:sha1:2fd84b9b839c3541815733701a06d9df48297a91</id>
<content type='text'>
The platform_get_irq might be failed and return a negative result. So
there should have an error handling code.

Fixed this by adding an error handling code.

Signed-off-by: Zhang Shurong &lt;zhang_shurong@foxmail.com&gt;
Link: https://lore.kernel.org/r/tencent_8E383752B54E5BF860711E500AD8A8971208@qq.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>uio: dfl: add vendor-specific feature id</title>
<updated>2023-05-31T18:00:37Z</updated>
<author>
<name>Peter Colberg</name>
<email>peter.colberg@intel.com</email>
</author>
<published>2023-05-31T03:07:37Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c9d9d11b8575a14d87e07950974950f975ba4b54'/>
<id>urn:sha1:c9d9d11b8575a14d87e07950974950f975ba4b54</id>
<content type='text'>
Add a Device Feature List (DFL) feature id as a generic mechanism
to expose a vendor-specific FPGA IP to user space. The feature id
is intended for use with IPs that do not need any kernel services
beyond exposure to user space through the UIO DFL driver.

The feature id is used in, e.g., Intel Oak Springs Canyon IPUs
to expose various IPs to user space, e.g., Network Controller
Sideband Interface (NC-SI), BaseNIC, and VirtIO management.

Link: https://github.com/OPAE/dfl-feature-id
Signed-off-by: Peter Colberg &lt;peter.colberg@intel.com&gt;
Signed-off-by: Matthew Gerlach &lt;matthew.gerlach@linux.intel.com&gt;
Reviewed-by: Russ Weight &lt;russell.h.weight@intel.com&gt;
Link: https://lore.kernel.org/r/20230531030737.12989-1-peter.colberg@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
