<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/misc/fastrpc.c, branch v5.4</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>misc: fastrpc: prevent memory leak in fastrpc_dma_buf_attach</title>
<updated>2019-10-04T16:22:14+00:00</updated>
<author>
<name>Navid Emamdoost</name>
<email>navid.emamdoost@gmail.com</email>
</author>
<published>2019-09-25T15:27:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=fc739a058d99c9297ef6bfd923b809d85855b9a9'/>
<id>fc739a058d99c9297ef6bfd923b809d85855b9a9</id>
<content type='text'>
In fastrpc_dma_buf_attach if dma_get_sgtable fails the allocated memory
for a should be released.

Signed-off-by: Navid Emamdoost &lt;navid.emamdoost@gmail.com&gt;
Link: https://lore.kernel.org/r/20190925152742.16258-1-navid.emamdoost@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In fastrpc_dma_buf_attach if dma_get_sgtable fails the allocated memory
for a should be released.

Signed-off-by: Navid Emamdoost &lt;navid.emamdoost@gmail.com&gt;
Link: https://lore.kernel.org/r/20190925152742.16258-1-navid.emamdoost@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>misc: fastrpc: free dma buf scatter list</title>
<updated>2019-09-04T11:35:11+00:00</updated>
<author>
<name>Srinivas Kandagatla</name>
<email>srinivas.kandagatla@linaro.org</email>
</author>
<published>2019-08-29T09:29:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=cf61860e6b090bea4050c5688566bfe357cacd11'/>
<id>cf61860e6b090bea4050c5688566bfe357cacd11</id>
<content type='text'>
dma buf scatter list is never freed, free it!

Orignally detected by kmemleak:
  backtrace:
    [&lt;ffffff80088b7658&gt;] kmemleak_alloc+0x50/0x84
    [&lt;ffffff8008373284&gt;] sg_kmalloc+0x38/0x60
    [&lt;ffffff8008373144&gt;] __sg_alloc_table+0x60/0x110
    [&lt;ffffff800837321c&gt;] sg_alloc_table+0x28/0x58
    [&lt;ffffff800837336c&gt;] __sg_alloc_table_from_pages+0xc0/0x1ac
    [&lt;ffffff800837346c&gt;] sg_alloc_table_from_pages+0x14/0x1c
    [&lt;ffffff8008097a3c&gt;] __iommu_get_sgtable+0x5c/0x8c
    [&lt;ffffff800850a1d0&gt;] fastrpc_dma_buf_attach+0x84/0xf8
    [&lt;ffffff80085114bc&gt;] dma_buf_attach+0x70/0xc8
    [&lt;ffffff8008509efc&gt;] fastrpc_map_create+0xf8/0x1e8
    [&lt;ffffff80085086f4&gt;] fastrpc_device_ioctl+0x508/0x900
    [&lt;ffffff80082428c8&gt;] compat_SyS_ioctl+0x128/0x200
    [&lt;ffffff80080832c4&gt;] el0_svc_naked+0x34/0x38
    [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff

Reported-by: Mayank Chopra &lt;mak.chopra@codeaurora.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20190829092926.12037-6-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dma buf scatter list is never freed, free it!

Orignally detected by kmemleak:
  backtrace:
    [&lt;ffffff80088b7658&gt;] kmemleak_alloc+0x50/0x84
    [&lt;ffffff8008373284&gt;] sg_kmalloc+0x38/0x60
    [&lt;ffffff8008373144&gt;] __sg_alloc_table+0x60/0x110
    [&lt;ffffff800837321c&gt;] sg_alloc_table+0x28/0x58
    [&lt;ffffff800837336c&gt;] __sg_alloc_table_from_pages+0xc0/0x1ac
    [&lt;ffffff800837346c&gt;] sg_alloc_table_from_pages+0x14/0x1c
    [&lt;ffffff8008097a3c&gt;] __iommu_get_sgtable+0x5c/0x8c
    [&lt;ffffff800850a1d0&gt;] fastrpc_dma_buf_attach+0x84/0xf8
    [&lt;ffffff80085114bc&gt;] dma_buf_attach+0x70/0xc8
    [&lt;ffffff8008509efc&gt;] fastrpc_map_create+0xf8/0x1e8
    [&lt;ffffff80085086f4&gt;] fastrpc_device_ioctl+0x508/0x900
    [&lt;ffffff80082428c8&gt;] compat_SyS_ioctl+0x128/0x200
    [&lt;ffffff80080832c4&gt;] el0_svc_naked+0x34/0x38
    [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff

Reported-by: Mayank Chopra &lt;mak.chopra@codeaurora.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20190829092926.12037-6-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>misc: fastrpc: fix double refcounting on dmabuf</title>
<updated>2019-09-04T11:35:11+00:00</updated>
<author>
<name>Srinivas Kandagatla</name>
<email>srinivas.kandagatla@linaro.org</email>
</author>
<published>2019-08-29T09:29:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5672ff4dc3898b6b74c114de2f53e667ab5a0327'/>
<id>5672ff4dc3898b6b74c114de2f53e667ab5a0327</id>
<content type='text'>
dma buf refcount has to be done by the driver which is going to use the fd.
This driver already does refcount on the dmabuf fd if its actively using it
but also does an additional refcounting via extra ioctl.
This additional refcount can lead to memory leak in cases where the
applications fail to call the ioctl to decrement the refcount.

So remove this extra refcount in the ioctl

More info of dma buf usage at drivers/dma-buf/dma-buf.c

Reported-by: Mayank Chopra &lt;mak.chopra@codeaurora.org&gt;
Reported-by: Jorge Ramirez-Ortiz &lt;jorge.ramirez-ortiz@linaro.org&gt;
Tested-by: Jorge Ramirez-Ortiz &lt;jorge.ramirez-ortiz@linaro.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20190829092926.12037-5-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dma buf refcount has to be done by the driver which is going to use the fd.
This driver already does refcount on the dmabuf fd if its actively using it
but also does an additional refcounting via extra ioctl.
This additional refcount can lead to memory leak in cases where the
applications fail to call the ioctl to decrement the refcount.

So remove this extra refcount in the ioctl

More info of dma buf usage at drivers/dma-buf/dma-buf.c

Reported-by: Mayank Chopra &lt;mak.chopra@codeaurora.org&gt;
Reported-by: Jorge Ramirez-Ortiz &lt;jorge.ramirez-ortiz@linaro.org&gt;
Tested-by: Jorge Ramirez-Ortiz &lt;jorge.ramirez-ortiz@linaro.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20190829092926.12037-5-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>misc: fastrpc: remove unused definition</title>
<updated>2019-09-04T11:35:11+00:00</updated>
<author>
<name>Jorge Ramirez-Ortiz</name>
<email>jorge.ramirez-ortiz@linaro.org</email>
</author>
<published>2019-08-29T09:29:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=15fe27f3162ee47c0363cd8cf53b351823479063'/>
<id>15fe27f3162ee47c0363cd8cf53b351823479063</id>
<content type='text'>
Remove unused INIT_MEMLEN_MAX define.

Signed-off-by: Jorge Ramirez-Ortiz &lt;jorge.ramirez-ortiz@linaro.org&gt;
Signed-off-by: Abhinav Asati &lt;asatiabhi@codeaurora.org&gt;
Signed-off-by: Vamsi Singamsetty &lt;vamssi@codeaurora.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20190829092926.12037-4-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove unused INIT_MEMLEN_MAX define.

Signed-off-by: Jorge Ramirez-Ortiz &lt;jorge.ramirez-ortiz@linaro.org&gt;
Signed-off-by: Abhinav Asati &lt;asatiabhi@codeaurora.org&gt;
Signed-off-by: Vamsi Singamsetty &lt;vamssi@codeaurora.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20190829092926.12037-4-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>misc: fastrpc: Don't reference rpmsg_device after remove</title>
<updated>2019-09-04T11:35:10+00:00</updated>
<author>
<name>Bjorn Andersson</name>
<email>bjorn.andersson@linaro.org</email>
</author>
<published>2019-08-29T09:29:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2e369878bd4399283f2950dc4947cf44c857dd74'/>
<id>2e369878bd4399283f2950dc4947cf44c857dd74</id>
<content type='text'>
As fastrpc_rpmsg_remove() returns the rpdev of the channel context is no
longer a valid object, so ensure to update the channel context to no
longer reference the old object and guard in the invoke code path
against dereferencing it.

Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Mayank Chopra &lt;mak.chopra@codeaurora.org&gt;
Signed-off-by: Abhinav Asati &lt;asatiabhi@codeaurora.org&gt;
Signed-off-by: Vamsi Singamsetty &lt;vamssi@codeaurora.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20190829092926.12037-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As fastrpc_rpmsg_remove() returns the rpdev of the channel context is no
longer a valid object, so ensure to update the channel context to no
longer reference the old object and guard in the invoke code path
against dereferencing it.

Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Mayank Chopra &lt;mak.chopra@codeaurora.org&gt;
Signed-off-by: Abhinav Asati &lt;asatiabhi@codeaurora.org&gt;
Signed-off-by: Vamsi Singamsetty &lt;vamssi@codeaurora.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20190829092926.12037-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>misc: fastrpc: Reference count channel context</title>
<updated>2019-09-04T11:35:10+00:00</updated>
<author>
<name>Bjorn Andersson</name>
<email>bjorn.andersson@linaro.org</email>
</author>
<published>2019-08-29T09:29:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=278d56f970ae6e0bcda8970e78e088e3efe43da8'/>
<id>278d56f970ae6e0bcda8970e78e088e3efe43da8</id>
<content type='text'>
The channel context is referenced from the fastrpc user and might as
user space holds the file descriptor open outlive the fastrpc device,
which is removed when the remote processor is shutting down.

Reference count the channel context in order to retain this object until
all references has been relinquished.

Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Mayank Chopra &lt;mak.chopra@codeaurora.org&gt;
Signed-off-by: Abhinav Asati &lt;asatiabhi@codeaurora.org&gt;
Signed-off-by: Vamsi Singamsetty &lt;vamssi@codeaurora.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20190829092926.12037-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The channel context is referenced from the fastrpc user and might as
user space holds the file descriptor open outlive the fastrpc device,
which is removed when the remote processor is shutting down.

Reference count the channel context in order to retain this object until
all references has been relinquished.

Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Mayank Chopra &lt;mak.chopra@codeaurora.org&gt;
Signed-off-by: Abhinav Asati &lt;asatiabhi@codeaurora.org&gt;
Signed-off-by: Vamsi Singamsetty &lt;vamssi@codeaurora.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Link: https://lore.kernel.org/r/20190829092926.12037-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>misc: fastrpc: fix memory leak when out of memory</title>
<updated>2019-07-25T12:46:17+00:00</updated>
<author>
<name>Jorge Ramirez-Ortiz</name>
<email>jorge.ramirez-ortiz@linaro.org</email>
</author>
<published>2019-07-05T08:13:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=41db5f8397eee75afff82655a4884b5786a1d302'/>
<id>41db5f8397eee75afff82655a4884b5786a1d302</id>
<content type='text'>
Do the necessary house-keeping if the allocated memory wont be used

Signed-off-by: Jorge Ramirez-Ortiz &lt;jorge.ramirez-ortiz@linaro.org&gt;
Link: https://lore.kernel.org/r/20190705081303.14170-1-jorge.ramirez-ortiz@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Do the necessary house-keeping if the allocated memory wont be used

Signed-off-by: Jorge Ramirez-Ortiz &lt;jorge.ramirez-ortiz@linaro.org&gt;
Link: https://lore.kernel.org/r/20190705081303.14170-1-jorge.ramirez-ortiz@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge 5.1-rc6 into char-misc-next</title>
<updated>2019-04-21T21:14:47+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-04-21T21:14:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3a26172437bb5ecdf6921e3ae24730ef37d3c860'/>
<id>3a26172437bb5ecdf6921e3ae24730ef37d3c860</id>
<content type='text'>
We want the fixes, and this resolves a merge error in the fastrpc
driver.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We want the fixes, and this resolves a merge error in the fastrpc
driver.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>misc: fastrpc: add checked value for dma_set_mask</title>
<updated>2019-04-02T15:56:54+00:00</updated>
<author>
<name>Bo YU</name>
<email>tsu.yubo@gmail.com</email>
</author>
<published>2019-03-28T07:47:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=01b76c32e3f30d54ab8ec1efeed3c6ecef7f6027'/>
<id>01b76c32e3f30d54ab8ec1efeed3c6ecef7f6027</id>
<content type='text'>
There be should check return value from dma_set_mask to throw some info
if fail to set dma mask.

Detected by CoverityScan, CID# 1443983:  Error handling issues (CHECKED_RETURN)

Fixes: f6f9279f2bf0 ("misc: fastrpc: Add Qualcomm fastrpc basic driver model")
Signed-off-by: Bo YU &lt;tsu.yubo@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There be should check return value from dma_set_mask to throw some info
if fail to set dma mask.

Detected by CoverityScan, CID# 1443983:  Error handling issues (CHECKED_RETURN)

Fixes: f6f9279f2bf0 ("misc: fastrpc: Add Qualcomm fastrpc basic driver model")
Signed-off-by: Bo YU &lt;tsu.yubo@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>misc: fastrpc: increase max init file size to 64 MB</title>
<updated>2019-03-27T17:09:58+00:00</updated>
<author>
<name>Srinivas Kandagatla</name>
<email>srinivas.kandagatla@linaro.org</email>
</author>
<published>2019-03-07T10:12:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f1cf11c296c599b81549aa2c5221d75138a58aa4'/>
<id>f1cf11c296c599b81549aa2c5221d75138a58aa4</id>
<content type='text'>
In some cases where Neural Processing is required the size of init process
exceeds default size of 2MB, increase this size to 64MB which is required
for QCS404 CDSP Neural Processing.

Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In some cases where Neural Processing is required the size of init process
exceeds default size of 2MB, increase this size to 64MB which is required
for QCS404 CDSP Neural Processing.

Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
