<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/misc/mic/vop, branch linux-4.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-10-29T08:05:43Z</updated>
<entry>
<title>misc: vop: add round_up(x,4) for vring_size to avoid kernel panic</title>
<updated>2020-10-29T08:05:43Z</updated>
<author>
<name>Sherry Sun</name>
</author>
<published>2020-09-29T09:11:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cc7a10623ac2cc48132db2911a4e1267ee398c62'/>
<id>urn:sha1:cc7a10623ac2cc48132db2911a4e1267ee398c62</id>
<content type='text'>
[ Upstream commit cc1a2679865a94b83804822996eed010a50a7c1d ]

Since struct _mic_vring_info and vring are allocated together and follow
vring, if the vring_size() is not four bytes aligned, which will cause
the start address of struct _mic_vring_info is not four byte aligned.
For example, when vring entries is 128, the vring_size() will be 5126
bytes. The _mic_vring_info struct layout in ddr looks like:
0x90002400:  00000000 00390000 EE010000 0000C0FF
Here 0x39 is the avail_idx member, and 0xC0FFEE01 is the magic member.

When EP use ioread32(magic) to reads the magic in RC's share memory, it
will cause kernel panic on ARM64 platform due to the cross-byte io read.
Here read magic in user space use le32toh(vr0-&gt;info-&gt;magic) will meet
the same issue.
So add round_up(x,4) for vring_size, then the struct _mic_vring_info
will store in this way:
0x90002400:  00000000 00000000 00000039 C0FFEE01
Which will avoid kernel panic when read magic in struct _mic_vring_info.

Signed-off-by: Sherry Sun &lt;sherry.sun@nxp.com&gt;
Signed-off-by: Joakim Zhang &lt;qiangqing.zhang@nxp.com&gt;
Link: https://lore.kernel.org/r/20200929091106.24624-4-sherry.sun@nxp.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>mic: vop: copy data to kernel space then write to io memory</title>
<updated>2020-10-29T08:05:43Z</updated>
<author>
<name>Sherry Sun</name>
</author>
<published>2020-09-29T09:11:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b0b36f6ecc129a35c3f2cdec8c68afd64a999b26'/>
<id>urn:sha1:b0b36f6ecc129a35c3f2cdec8c68afd64a999b26</id>
<content type='text'>
[ Upstream commit 675f0ad4046946e80412896436164d172cd92238 ]

Read and write io memory should address align on ARCH ARM. Change to use
memcpy_toio to avoid kernel panic caused by the address un-align issue.

Signed-off-by: Sherry Sun &lt;sherry.sun@nxp.com&gt;
Signed-off-by: Joakim Zhang &lt;qiangqing.zhang@nxp.com&gt;
Link: https://lore.kernel.org/r/20200929091106.24624-5-sherry.sun@nxp.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>misc: mic: double free on ioctl error path</title>
<updated>2017-06-24T05:11:16Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2017-01-09T08:20:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f28ba80c6a3e8bf7ec96e06667dd82e98ae1c672'/>
<id>urn:sha1:f28ba80c6a3e8bf7ec96e06667dd82e98ae1c672</id>
<content type='text'>
commit 816c9311f1144a03da1fdc4feb2f6b0d3299fca0 upstream.

This function only has one caller.  Freeing "vdev" here leads to a use
after free bug.  There are several other error paths in this function
but this is the only one which frees "vdev".  It looks like the kfree()
can be safely removed.

Fixes: 61e9c905df78 ("misc: mic: Enable VOP host side functionality")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>misc: mic: Fix for double fetch security bug in VOP driver</title>
<updated>2016-04-27T22:30:58Z</updated>
<author>
<name>Ashutosh Dixit</name>
</author>
<published>2016-04-27T21:36:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=82dc4afd7e65455464f0fc2fe6976efde54fe451'/>
<id>urn:sha1:82dc4afd7e65455464f0fc2fe6976efde54fe451</id>
<content type='text'>
The MIC VOP driver does two successive reads from user space to read a
variable length data structure. Kernel memory corruption can result if
the data structure changes between the two reads. This patch disallows
the chance of this happening.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=116651
Reported by: Pengfei Wang &lt;wpengfeinudt@gmail.com&gt;
Reviewed-by: Sudeep Dutt &lt;sudeep.dutt@intel.com&gt;
Signed-off-by: Ashutosh Dixit &lt;ashutosh.dixit@intel.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: mic: silence an overflow warning</title>
<updated>2016-02-15T01:42:37Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2016-02-12T06:44:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=59ea25904406a606d1329650e45e13e682e89320'/>
<id>urn:sha1:59ea25904406a606d1329650e45e13e682e89320</id>
<content type='text'>
Static checkers complain that the this is a potential array overflow.
We verify that it's not on the next line so this code is OK, but
static checker warnings are annoying.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: mic: use after free printing error message</title>
<updated>2016-02-15T01:42:37Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2016-02-12T06:40:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6ddf2f0cb1e1931d16e08e30130ed04e5a441f2c'/>
<id>urn:sha1:6ddf2f0cb1e1931d16e08e30130ed04e5a441f2c</id>
<content type='text'>
Swap the printk and kfree() to avoid a use after free bug.

Fixes: 61e9c905df78 ('misc: mic: Enable VOP host side functionality')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: mic: Enable VOP debugfs and driver build</title>
<updated>2016-02-10T01:32:37Z</updated>
<author>
<name>Sudeep Dutt</name>
</author>
<published>2016-02-08T23:48:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8810df37762746657cfe84014a8f30758e8f366a'/>
<id>urn:sha1:8810df37762746657cfe84014a8f30758e8f366a</id>
<content type='text'>
This patch moves the virtio specific debugfs hooks previously in
mic_debugfs.c in the MIC host driver into the VOP driver. The
Kconfig/Makefile is also updated to allow building the VOP driver.

Reviewed-by: Ashutosh Dixit &lt;ashutosh.dixit@intel.com&gt;
Signed-off-by: Sudeep Dutt &lt;sudeep.dutt@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: mic: Enable VOP card side functionality</title>
<updated>2016-02-10T01:32:37Z</updated>
<author>
<name>Ashutosh Dixit</name>
</author>
<published>2016-02-08T23:48:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c1becd2849681e8be1043d2ce9034a9d9bb3d540'/>
<id>urn:sha1:c1becd2849681e8be1043d2ce9034a9d9bb3d540</id>
<content type='text'>
This patch moves virtio functionality from the MIC card driver into a
separate hardware independent Virtio Over PCIe (VOP) driver. This
functionality was introduced in commit 2141c7c5ee67 ("Intel MIC Card
Driver Changes for Virtio Devices.") in
drivers/misc/mic/card/mic_virtio.c. Apart from being moved into a
separate driver the functionality is essentially unchanged. See the
above mentioned commit for a description of this functionality.

Signed-off-by: Sudeep Dutt &lt;sudeep.dutt@intel.com&gt;
Signed-off-by: Ashutosh Dixit &lt;ashutosh.dixit@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: mic: Enable VOP host side functionality</title>
<updated>2016-02-10T01:32:37Z</updated>
<author>
<name>Sudeep Dutt</name>
</author>
<published>2016-02-08T23:48:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=61e9c905df78c253752971e200f0ac6d8667dda6'/>
<id>urn:sha1:61e9c905df78c253752971e200f0ac6d8667dda6</id>
<content type='text'>
This patch moves virtio functionality from the MIC host driver into a
separate hardware independent Virtio Over PCIe (VOP) driver. This
functionality was introduced in commit f69bcbf3b4c4 ("Intel MIC Host
Driver Changes for Virtio Devices.") in
drivers/misc/mic/host/mic_virtio.c. Apart from being moved into a
separate driver the functionality is essentially unchanged. See the
above mentioned commit for a description of this functionality.

Signed-off-by: Ashutosh Dixit &lt;ashutosh.dixit@intel.com&gt;
Signed-off-by: Sudeep Dutt &lt;sudeep.dutt@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: mic: Add data structures for the VOP driver</title>
<updated>2016-02-10T01:32:37Z</updated>
<author>
<name>Sudeep Dutt</name>
</author>
<published>2016-02-08T23:48:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=26909e26f4b51a9f7f8838eee775a65563388c0d'/>
<id>urn:sha1:26909e26f4b51a9f7f8838eee775a65563388c0d</id>
<content type='text'>
This patch adds VOP driver data structures used in subsequent
patches. These data structures are refactored from similar data
structures used in the virtio parts of previous MIC host and card
drivers.

Signed-off-by: Ashutosh Dixit &lt;ashutosh.dixit@intel.com&gt;
Signed-off-by: Sudeep Dutt &lt;sudeep.dutt@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
