<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/rpmsg, branch v5.4.43</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.4.43</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.4.43'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2020-01-14T19:08:37Z</updated>
<entry>
<title>rpmsg: char: release allocated memory</title>
<updated>2020-01-14T19:08:37Z</updated>
<author>
<name>Navid Emamdoost</name>
<email>navid.emamdoost@gmail.com</email>
</author>
<published>2019-09-17T03:31:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5bbe72cf486c3b983f739b3e1d98b61c8a205795'/>
<id>urn:sha1:5bbe72cf486c3b983f739b3e1d98b61c8a205795</id>
<content type='text'>
commit bbe692e349e2a1edf3fe0a29a0e05899c9c94d51 upstream.

In rpmsg_eptdev_write_iter, if copy_from_iter_full fails the allocated
buffer needs to be released.

Signed-off-by: Navid Emamdoost &lt;navid.emamdoost@gmail.com&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Cc: Ben Hutchings &lt;ben.hutchings@codethink.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>rpmsg: glink: Free pending deferred work on remove</title>
<updated>2019-12-21T10:04:41Z</updated>
<author>
<name>Bjorn Andersson</name>
<email>bjorn.andersson@linaro.org</email>
</author>
<published>2019-10-04T22:27:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=adcd240d5cb688b8256045cf80849f1e8fa4a8f9'/>
<id>urn:sha1:adcd240d5cb688b8256045cf80849f1e8fa4a8f9</id>
<content type='text'>
commit 278bcb7300f61785dba63840bd2a8cf79f14554c upstream.

By just cancelling the deferred rx worker during GLINK instance teardown
any pending deferred commands are leaked, so free them.

Fixes: b4f8e52b89f6 ("rpmsg: Introduce Qualcomm RPM glink driver")
Cc: stable@vger.kernel.org
Acked-by: Chris Lew &lt;clew@codeaurora.org&gt;
Tested-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>rpmsg: glink: Don't send pending rx_done during remove</title>
<updated>2019-12-21T10:04:40Z</updated>
<author>
<name>Bjorn Andersson</name>
<email>bjorn.andersson@linaro.org</email>
</author>
<published>2019-10-04T22:27:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=84afec146da361e7d17097e5ac1f8e8da0b3fe6e'/>
<id>urn:sha1:84afec146da361e7d17097e5ac1f8e8da0b3fe6e</id>
<content type='text'>
commit c3dadc19b7564c732598b30d637c6f275c3b77b6 upstream.

Attempting to transmit rx_done messages after the GLINK instance is
being torn down will cause use after free and memory leaks. So cancel
the intent_work and free up the pending intents.

With this there are no concurrent accessors of the channel left during
qcom_glink_native_remove() and there is therefor no need to hold the
spinlock during this operation - which would prohibit the use of
cancel_work_sync() in the release function. So remove this.

Fixes: 1d2ea36eead9 ("rpmsg: glink: Add rx done command")
Cc: stable@vger.kernel.org
Acked-by: Chris Lew &lt;clew@codeaurora.org&gt;
Tested-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>rpmsg: glink: Fix rpmsg_register_device err handling</title>
<updated>2019-12-21T10:04:39Z</updated>
<author>
<name>Chris Lew</name>
<email>clew@codeaurora.org</email>
</author>
<published>2019-10-04T22:27:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e7e682b1640543ceb5ee9500f8da82bf813f42da'/>
<id>urn:sha1:e7e682b1640543ceb5ee9500f8da82bf813f42da</id>
<content type='text'>
commit f7e714988edaffe6ac578318e99501149b067ba0 upstream.

The device release function is set before registering with rpmsg. If
rpmsg registration fails, the framework will call device_put(), which
invokes the release function. The channel create logic does not need to
free rpdev if rpmsg_register_device() fails and release is called.

Fixes: b4f8e52b89f6 ("rpmsg: Introduce Qualcomm RPM glink driver")
Cc: stable@vger.kernel.org
Tested-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Chris Lew &lt;clew@codeaurora.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>rpmsg: glink: Put an extra reference during cleanup</title>
<updated>2019-12-21T10:04:38Z</updated>
<author>
<name>Chris Lew</name>
<email>clew@codeaurora.org</email>
</author>
<published>2019-10-04T22:26:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1cbc40a07c195617b9475a916a405d005fd49ad2'/>
<id>urn:sha1:1cbc40a07c195617b9475a916a405d005fd49ad2</id>
<content type='text'>
commit b646293e272816dd0719529dcebbd659de0722f7 upstream.

In a remote processor crash scenario, there is no guarantee the remote
processor sent close requests before it went into a bad state. Remove
the reference that is normally handled by the close command in the
so channel resources can be released.

Fixes: b4f8e52b89f6 ("rpmsg: Introduce Qualcomm RPM glink driver")
Cc: stable@vger.kernel.org
Tested-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Chris Lew &lt;clew@codeaurora.org&gt;
Reported-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>rpmsg: glink: Fix use after free in open_ack TIMEOUT case</title>
<updated>2019-12-21T10:04:37Z</updated>
<author>
<name>Arun Kumar Neelakantam</name>
<email>aneela@codeaurora.org</email>
</author>
<published>2019-10-04T22:26:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d375fb033a82ebbc7d0774618586785851c39c78'/>
<id>urn:sha1:d375fb033a82ebbc7d0774618586785851c39c78</id>
<content type='text'>
commit ac74ea01860170699fb3b6ea80c0476774c8e94f upstream.

Extra channel reference put when remote sending OPEN_ACK after timeout
causes use-after-free while handling next remote CLOSE command.

Remove extra reference put in timeout case to avoid use-after-free.

Fixes: b4f8e52b89f6 ("rpmsg: Introduce Qualcomm RPM glink driver")
Cc: stable@vger.kernel.org
Tested-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Arun Kumar Neelakantam &lt;aneela@codeaurora.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>rpmsg: glink: Fix reuse intents memory leak issue</title>
<updated>2019-12-21T10:04:37Z</updated>
<author>
<name>Arun Kumar Neelakantam</name>
<email>aneela@codeaurora.org</email>
</author>
<published>2019-10-04T22:26:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bee84d7d8b13926af3933cd054a734bf71ef3ad8'/>
<id>urn:sha1:bee84d7d8b13926af3933cd054a734bf71ef3ad8</id>
<content type='text'>
commit b85f6b601407347f5425c4c058d1b7871f5bf4f0 upstream.

Memory allocated for re-usable intents are not freed during channel
cleanup which causes memory leak in system.

Check and free all re-usable memory to avoid memory leak.

Fixes: 933b45da5d1d ("rpmsg: glink: Add support for TX intents")
Cc: stable@vger.kernel.org
Acked-By: Chris Lew &lt;clew@codeaurora.org&gt;
Tested-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Arun Kumar Neelakantam &lt;aneela@codeaurora.org&gt;
Reported-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>rpmsg: glink: Set tail pointer to 0 at end of FIFO</title>
<updated>2019-12-21T10:04:36Z</updated>
<author>
<name>Chris Lew</name>
<email>clew@codeaurora.org</email>
</author>
<published>2018-06-28T01:19:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=06e60a45a429bcbe5be9eefb78b218382031f90e'/>
<id>urn:sha1:06e60a45a429bcbe5be9eefb78b218382031f90e</id>
<content type='text'>
commit 4623e8bf1de0b86e23a56cdb39a72f054e89c3bd upstream.

When wrapping around the FIFO, the remote expects the tail pointer to
be reset to 0 on the edge case where the tail equals the FIFO length.

Fixes: caf989c350e8 ("rpmsg: glink: Introduce glink smem based transport")
Cc: stable@vger.kernel.org
Signed-off-by: Chris Lew &lt;clew@codeaurora.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>rpmsg: glink-smem: Name the edge based on parent remoteproc</title>
<updated>2019-09-17T22:33:31Z</updated>
<author>
<name>Bjorn Andersson</name>
<email>bjorn.andersson@linaro.org</email>
</author>
<published>2019-08-20T04:16:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9fe69a725e238ac279027f0132e50617a63b847d'/>
<id>urn:sha1:9fe69a725e238ac279027f0132e50617a63b847d</id>
<content type='text'>
Naming the glink edge device on the parent of_node short name causes
collisions when multiple remoteproc instances with only different unit
address are described on the platform_bus in DeviceTree.

Base the edge's name on the parent remoteproc's name instead, to ensure
that it's unique.

Reviewed-by: Niklas Cassel &lt;niklas.cassel@linaro.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
</content>
</entry>
<entry>
<title>rpmsg: glink: Use struct_size() helper</title>
<updated>2019-08-29T18:24:31Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2019-08-29T18:17:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=61c65f47f30a1f32e0a84fe8335cd0360a028b48'/>
<id>urn:sha1:61c65f47f30a1f32e0a84fe8335cd0360a028b48</id>
<content type='text'>
One of the more common cases of allocation size calculations is finding
the size of a structure that has a zero-sized array at the end, along
with memory for some number of elements for that array. For example:

struct {
	...
	struct intent_pair intents[];
} __packed * msg;

Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes.

So, replace the following form:

sizeof(*msg) + sizeof(struct intent_pair) * count

with:

struct_size(msg, intents, count)

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
</content>
</entry>
</feed>
