<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/misc/fastrpc.c, branch v5.4.23</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.4.23</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.4.23'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2019-12-31T15:43:58Z</updated>
<entry>
<title>misc: fastrpc: fix memory leak from miscdev-&gt;name</title>
<updated>2019-12-31T15:43:58Z</updated>
<author>
<name>Srinivas Kandagatla</name>
<email>srinivas.kandagatla@linaro.org</email>
</author>
<published>2019-10-09T14:41:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6083bbaee80f6bc4e489c3648db9a23175b0c4a9'/>
<id>urn:sha1:6083bbaee80f6bc4e489c3648db9a23175b0c4a9</id>
<content type='text'>
[ Upstream commit 2d10d2d170723e9278282458a6704552dcb77eac ]

Fix a memory leak in miscdev-&gt;name by using devm_variant

Orignally reported by kmemleak:
    [&lt;ffffff80088b74d8&gt;] kmemleak_alloc+0x50/0x84
    [&lt;ffffff80081e015c&gt;] __kmalloc_track_caller+0xe8/0x168
    [&lt;ffffff8008371ab0&gt;] kvasprintf+0x78/0x100
    [&lt;ffffff8008371c6c&gt;] kasprintf+0x50/0x74
    [&lt;ffffff8008507f2c&gt;] fastrpc_rpmsg_probe+0xd8/0x20c
    [&lt;ffffff80086b63b4&gt;] rpmsg_dev_probe+0xa8/0x148
    [&lt;ffffff80084de50c&gt;] really_probe+0x208/0x248
    [&lt;ffffff80084de2dc&gt;] driver_probe_device+0x98/0xc0
    [&lt;ffffff80084dec6c&gt;] __device_attach_driver+0x9c/0xac
    [&lt;ffffff80084dca8c&gt;] bus_for_each_drv+0x60/0x8c
    [&lt;ffffff80084de64c&gt;] __device_attach+0x8c/0x100
    [&lt;ffffff80084de6e0&gt;] device_initial_probe+0x20/0x28
    [&lt;ffffff80084dcbd0&gt;] bus_probe_device+0x34/0x7c
    [&lt;ffffff80084da32c&gt;] device_add+0x420/0x498
    [&lt;ffffff80084da680&gt;] device_register+0x24/0x2c

Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Reviewed-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Link: https://lore.kernel.org/r/20191009144123.24583-3-srinivas.kandagatla@linaro.org
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: fastrpc: prevent memory leak in fastrpc_dma_buf_attach</title>
<updated>2019-10-04T16:22:14Z</updated>
<author>
<name>Navid Emamdoost</name>
<email>navid.emamdoost@gmail.com</email>
</author>
<published>2019-09-25T15:27:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fc739a058d99c9297ef6bfd923b809d85855b9a9'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>misc: fastrpc: free dma buf scatter list</title>
<updated>2019-09-04T11:35:11Z</updated>
<author>
<name>Srinivas Kandagatla</name>
<email>srinivas.kandagatla@linaro.org</email>
</author>
<published>2019-08-29T09:29:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cf61860e6b090bea4050c5688566bfe357cacd11'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>misc: fastrpc: fix double refcounting on dmabuf</title>
<updated>2019-09-04T11:35:11Z</updated>
<author>
<name>Srinivas Kandagatla</name>
<email>srinivas.kandagatla@linaro.org</email>
</author>
<published>2019-08-29T09:29:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5672ff4dc3898b6b74c114de2f53e667ab5a0327'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>misc: fastrpc: remove unused definition</title>
<updated>2019-09-04T11:35:11Z</updated>
<author>
<name>Jorge Ramirez-Ortiz</name>
<email>jorge.ramirez-ortiz@linaro.org</email>
</author>
<published>2019-08-29T09:29:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=15fe27f3162ee47c0363cd8cf53b351823479063'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>misc: fastrpc: Don't reference rpmsg_device after remove</title>
<updated>2019-09-04T11:35:10Z</updated>
<author>
<name>Bjorn Andersson</name>
<email>bjorn.andersson@linaro.org</email>
</author>
<published>2019-08-29T09:29:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2e369878bd4399283f2950dc4947cf44c857dd74'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>misc: fastrpc: Reference count channel context</title>
<updated>2019-09-04T11:35:10Z</updated>
<author>
<name>Bjorn Andersson</name>
<email>bjorn.andersson@linaro.org</email>
</author>
<published>2019-08-29T09:29:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=278d56f970ae6e0bcda8970e78e088e3efe43da8'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>misc: fastrpc: fix memory leak when out of memory</title>
<updated>2019-07-25T12:46:17Z</updated>
<author>
<name>Jorge Ramirez-Ortiz</name>
<email>jorge.ramirez-ortiz@linaro.org</email>
</author>
<published>2019-07-05T08:13:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=41db5f8397eee75afff82655a4884b5786a1d302'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>Merge 5.1-rc6 into char-misc-next</title>
<updated>2019-04-21T21:14:47Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-04-21T21:14:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3a26172437bb5ecdf6921e3ae24730ef37d3c860'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>misc: fastrpc: add checked value for dma_set_mask</title>
<updated>2019-04-02T15:56:54Z</updated>
<author>
<name>Bo YU</name>
<email>tsu.yubo@gmail.com</email>
</author>
<published>2019-03-28T07:47:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=01b76c32e3f30d54ab8ec1efeed3c6ecef7f6027'/>
<id>urn:sha1: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>
</entry>
</feed>
