<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/char, branch v5.4.276</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.4.276</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.4.276'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2024-02-23T07:24:48Z</updated>
<entry>
<title>hwrng: core - Fix page fault dead lock on mmap-ed hwrng</title>
<updated>2024-02-23T07:24:48Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2023-12-02T01:01:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5030d4c798863ccb266563201b341a099e8cdd48'/>
<id>urn:sha1:5030d4c798863ccb266563201b341a099e8cdd48</id>
<content type='text'>
commit 78aafb3884f6bc6636efcc1760c891c8500b9922 upstream.

There is a dead-lock in the hwrng device read path.  This triggers
when the user reads from /dev/hwrng into memory also mmap-ed from
/dev/hwrng.  The resulting page fault triggers a recursive read
which then dead-locks.

Fix this by using a stack buffer when calling copy_to_user.

Reported-by: Edward Adam Davis &lt;eadavis@qq.com&gt;
Reported-by: syzbot+c52ab18308964d248092@syzkaller.appspotmail.com
Fixes: 9996508b3353 ("hwrng: core - Replace u32 in driver API with byte array")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>hwrng: geode - fix accessing registers</title>
<updated>2023-11-20T09:30:12Z</updated>
<author>
<name>Jonas Gorski</name>
<email>jonas.gorski@gmail.com</email>
</author>
<published>2023-09-10T08:34:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f5d95a39683e0113443ebfcf1e94e4732b8332fa'/>
<id>urn:sha1:f5d95a39683e0113443ebfcf1e94e4732b8332fa</id>
<content type='text'>
[ Upstream commit 464bd8ec2f06707f3773676a1bd2c64832a3c805 ]

When the membase and pci_dev pointer were moved to a new struct in priv,
the actual membase users were left untouched, and they started reading
out arbitrary memory behind the struct instead of registers. This
unfortunately turned the RNG into a constant number generator, depending
on the content of what was at that offset.

To fix this, update geode_rng_data_{read,present}() to also get the
membase via amd_geode_priv, and properly read from the right addresses
again.

Fixes: 9f6ec8dc574e ("hwrng: geode - Fix PCI device refcount leak")
Reported-by: Timur I. Davletshin &lt;timur.davletshin@gmail.com&gt;
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217882
Tested-by: Timur I. Davletshin &lt;timur.davletshin@gmail.com&gt;
Suggested-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
Signed-off-by: Jonas Gorski &lt;jonas.gorski@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>parisc: sba: Fix compile warning wrt list of SBA devices</title>
<updated>2023-10-10T19:46:39Z</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2023-08-30T06:10:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f1a0dd9243f0dad89ba12abfbc18984db9d1a07f'/>
<id>urn:sha1:f1a0dd9243f0dad89ba12abfbc18984db9d1a07f</id>
<content type='text'>
[ Upstream commit eb3255ee8f6f4691471a28fbf22db5e8901116cd ]

Fix this makecheck warning:
drivers/parisc/sba_iommu.c:98:19: warning: symbol 'sba_list'
	was not declared. Should it be static?

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tpm_tis: Resend command to recover from data transfer errors</title>
<updated>2023-09-23T09:00:03Z</updated>
<author>
<name>Alexander Steffen</name>
<email>Alexander.Steffen@infineon.com</email>
</author>
<published>2023-06-13T18:02:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ff75c853b7dbd71757cabbd010c492146b8072e1'/>
<id>urn:sha1:ff75c853b7dbd71757cabbd010c492146b8072e1</id>
<content type='text'>
[ Upstream commit 280db21e153d8810ce3b93640c63ae922bcb9e8e ]

Similar to the transmission of TPM responses, also the transmission of TPM
commands may become corrupted. Instead of aborting when detecting such
issues, try resending the command again.

Signed-off-by: Alexander Steffen &lt;Alexander.Steffen@infineon.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ipmi_si: fix a memleak in try_smi_init()</title>
<updated>2023-09-23T08:59:54Z</updated>
<author>
<name>Yi Yang</name>
<email>yiyang13@huawei.com</email>
</author>
<published>2023-06-29T12:33:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f53ab5a2bf20fed59a2f7542d3453228b8056358'/>
<id>urn:sha1:f53ab5a2bf20fed59a2f7542d3453228b8056358</id>
<content type='text'>
commit 6cf1a126de2992b4efe1c3c4d398f8de4aed6e3f upstream.

Kmemleak reported the following leak info in try_smi_init():

unreferenced object 0xffff00018ecf9400 (size 1024):
  comm "modprobe", pid 2707763, jiffies 4300851415 (age 773.308s)
  backtrace:
    [&lt;000000004ca5b312&gt;] __kmalloc+0x4b8/0x7b0
    [&lt;00000000953b1072&gt;] try_smi_init+0x148/0x5dc [ipmi_si]
    [&lt;000000006460d325&gt;] 0xffff800081b10148
    [&lt;0000000039206ea5&gt;] do_one_initcall+0x64/0x2a4
    [&lt;00000000601399ce&gt;] do_init_module+0x50/0x300
    [&lt;000000003c12ba3c&gt;] load_module+0x7a8/0x9e0
    [&lt;00000000c246fffe&gt;] __se_sys_init_module+0x104/0x180
    [&lt;00000000eea99093&gt;] __arm64_sys_init_module+0x24/0x30
    [&lt;0000000021b1ef87&gt;] el0_svc_common.constprop.0+0x94/0x250
    [&lt;0000000070f4f8b7&gt;] do_el0_svc+0x48/0xe0
    [&lt;000000005a05337f&gt;] el0_svc+0x24/0x3c
    [&lt;000000005eb248d6&gt;] el0_sync_handler+0x160/0x164
    [&lt;0000000030a59039&gt;] el0_sync+0x160/0x180

The problem was that when an error occurred before handlers registration
and after allocating `new_smi-&gt;si_sm`, the variable wouldn't be freed in
the error handling afterwards since `shutdown_smi()` hadn't been
registered yet. Fix it by adding a `kfree()` in the error handling path
in `try_smi_init()`.

Cc: stable@vger.kernel.org # 4.19+
Fixes: 7960f18a5647 ("ipmi_si: Convert over to a shutdown handler")
Signed-off-by: Yi Yang &lt;yiyang13@huawei.com&gt;
Co-developed-by: GONG, Ruiqi &lt;gongruiqi@huaweicloud.com&gt;
Signed-off-by: GONG, Ruiqi &lt;gongruiqi@huaweicloud.com&gt;
Message-Id: &lt;20230629123328.2402075-1-gongruiqi@huaweicloud.com&gt;
Signed-off-by: Corey Minyard &lt;minyard@acm.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ipmi:ssif: Fix a memory leak when scanning for an adapter</title>
<updated>2023-09-23T08:59:46Z</updated>
<author>
<name>Corey Minyard</name>
<email>minyard@acm.org</email>
</author>
<published>2023-06-19T16:43:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=de677f4379fa67f650e367c188a0f80bee9b6732'/>
<id>urn:sha1:de677f4379fa67f650e367c188a0f80bee9b6732</id>
<content type='text'>
[ Upstream commit b8d72e32e1453d37ee5c8a219f24e7eeadc471ef ]

The adapter scan ssif_info_find() sets info-&gt;adapter_name if the adapter
info came from SMBIOS, as it's not set in that case.  However, this
function can be called more than once, and it will leak the adapter name
if it had already been set.  So check for NULL before setting it.

Fixes: c4436c9149c5 ("ipmi_ssif: avoid registering duplicate ssif interface")
Signed-off-by: Corey Minyard &lt;minyard@acm.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ipmi:ssif: Add check for kstrdup</title>
<updated>2023-09-23T08:59:46Z</updated>
<author>
<name>Jiasheng Jiang</name>
<email>jiasheng@iscas.ac.cn</email>
</author>
<published>2023-06-19T09:28:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ef0d286989b1c406d58751467dc2838a28978055'/>
<id>urn:sha1:ef0d286989b1c406d58751467dc2838a28978055</id>
<content type='text'>
[ Upstream commit c5586d0f711e9744d0cade39b0c4a2d116a333ca ]

Add check for the return value of kstrdup() and return the error
if it fails in order to avoid NULL pointer dereference.

Fixes: c4436c9149c5 ("ipmi_ssif: avoid registering duplicate ssif interface")
Signed-off-by: Jiasheng Jiang &lt;jiasheng@iscas.ac.cn&gt;
Message-Id: &lt;20230619092802.35384-1-jiasheng@iscas.ac.cn&gt;
Signed-off-by: Corey Minyard &lt;minyard@acm.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>hwrng: iproc-rng200 - Implement suspend and resume calls</title>
<updated>2023-09-23T08:59:42Z</updated>
<author>
<name>Florian Fainelli</name>
<email>florian.fainelli@broadcom.com</email>
</author>
<published>2023-08-10T19:22:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=12bf7d9cc6af27f0107ccae934ab1fa0020be31f'/>
<id>urn:sha1:12bf7d9cc6af27f0107ccae934ab1fa0020be31f</id>
<content type='text'>
[ Upstream commit 8e03dd62e5be811efbf0cbeba47e79e793519105 ]

Chips such as BCM7278 support system wide suspend/resume which will
cause the HWRNG block to lose its state and reset to its power on reset
register values. We need to cleanup and re-initialize the HWRNG for it
to be functional coming out of a system suspend cycle.

Fixes: c3577f6100ca ("hwrng: iproc-rng200 - Add support for BCM7278")
Signed-off-by: Florian Fainelli &lt;florian.fainelli@broadcom.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>hwrng: iproc-rng200 - use semicolons rather than commas to separate statements</title>
<updated>2023-09-23T08:59:42Z</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@inria.fr</email>
</author>
<published>2020-09-27T19:12:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4f1ca8e39732a38507862b93405208065ff9a3af'/>
<id>urn:sha1:4f1ca8e39732a38507862b93405208065ff9a3af</id>
<content type='text'>
[ Upstream commit f9dc446cb959d1efdb971fb3cde18c354a4a04c9 ]

Replace commas with semicolons.  What is done is essentially described by
the following Coccinelle semantic patch (http://coccinelle.lip6.fr/):

// &lt;smpl&gt;
@@ expression e1,e2; @@
e1
-,
+;
e2
... when any
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
Acked-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Stable-dep-of: 8e03dd62e5be ("hwrng: iproc-rng200 - Implement suspend and resume calls")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tpm_tis: Explicitly check for error code</title>
<updated>2023-08-11T09:53:52Z</updated>
<author>
<name>Alexander Steffen</name>
<email>Alexander.Steffen@infineon.com</email>
</author>
<published>2023-06-13T18:02:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a0019e13a9e97e56d8e4f4fbaa745babc6f61f5d'/>
<id>urn:sha1:a0019e13a9e97e56d8e4f4fbaa745babc6f61f5d</id>
<content type='text'>
commit 513253f8c293c0c8bd46d09d337fc892bf8f9f48 upstream.

recv_data either returns the number of received bytes, or a negative value
representing an error code. Adding the return value directly to the total
number of received bytes therefore looks a little weird, since it might add
a negative error code to a sum of bytes.

The following check for size &lt; expected usually makes the function return
ETIME in that case, so it does not cause too many problems in practice. But
to make the code look cleaner and because the caller might still be
interested in the original error code, explicitly check for the presence of
an error code and pass that through.

Cc: stable@vger.kernel.org
Fixes: cb5354253af2 ("[PATCH] tpm: spacing cleanups 2")
Signed-off-by: Alexander Steffen &lt;Alexander.Steffen@infineon.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
