<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/char, branch v6.6.39</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.39</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.39'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-06-16T11:47:41+00:00</updated>
<entry>
<title>tpm_tis: Do *not* flush uninitialized work</title>
<updated>2024-06-16T11:47:41+00:00</updated>
<author>
<name>Jan Beulich</name>
<email>jbeulich@suse.com</email>
</author>
<published>2024-05-29T12:23:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b54d24eb4a67ba9534f14b014756246ef1f704d1'/>
<id>urn:sha1:b54d24eb4a67ba9534f14b014756246ef1f704d1</id>
<content type='text'>
commit 0ea00e249ca992adee54dc71a526ee70ef109e40 upstream.

tpm_tis_core_init() may fail before tpm_tis_probe_irq_single() is
called, in which case tpm_tis_remove() unconditionally calling
flush_work() is triggering a warning for .func still being NULL.

Cc: stable@vger.kernel.org # v6.5+
Fixes: 481c2d14627d ("tpm,tpm_tis: Disable interrupts after 1000 unhandled IRQs")
Signed-off-by: Jan Beulich &lt;jbeulich@suse.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>
<entry>
<title>tpm_tis_spi: Account for SPI header when allocating TPM SPI xfer buffer</title>
<updated>2024-06-12T09:12:51+00:00</updated>
<author>
<name>Matthew R. Ochs</name>
<email>mochs@nvidia.com</email>
</author>
<published>2024-05-22T12:06:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1547183852dcdfcc25878db7dd3620509217b0cd'/>
<id>urn:sha1:1547183852dcdfcc25878db7dd3620509217b0cd</id>
<content type='text'>
[ Upstream commit 195aba96b854dd664768f382cd1db375d8181f88 ]

The TPM SPI transfer mechanism uses MAX_SPI_FRAMESIZE for computing the
maximum transfer length and the size of the transfer buffer. As such, it
does not account for the 4 bytes of header that prepends the SPI data
frame. This can result in out-of-bounds accesses and was confirmed with
KASAN.

Introduce SPI_HDRSIZE to account for the header and use to allocate the
transfer buffer.

Fixes: a86a42ac2bd6 ("tpm_tis_spi: Add hardware wait polling")
Signed-off-by: Matthew R. Ochs &lt;mochs@nvidia.com&gt;
Tested-by: Carol Soto &lt;csoto@nvidia.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>ppdev: Add an error check in register_device</title>
<updated>2024-06-12T09:12:26+00:00</updated>
<author>
<name>Huai-Yuan Liu</name>
<email>qq810974084@gmail.com</email>
</author>
<published>2024-04-12T08:38:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ec3468221efec6660ff656e9ebe51ced3520fc57'/>
<id>urn:sha1:ec3468221efec6660ff656e9ebe51ced3520fc57</id>
<content type='text'>
[ Upstream commit fbf740aeb86a4fe82ad158d26d711f2f3be79b3e ]

In register_device, the return value of ida_simple_get is unchecked,
in witch ida_simple_get will use an invalid index value.

To address this issue, index should be checked after ida_simple_get. When
the index value is abnormal, a warning message should be printed, the port
should be dropped, and the value should be recorded.

Fixes: 9a69645dde11 ("ppdev: fix registering same device name")
Signed-off-by: Huai-Yuan Liu &lt;qq810974084@gmail.com&gt;
Link: https://lore.kernel.org/r/20240412083840.234085-1-qq810974084@gmail.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>ppdev: Remove usage of the deprecated ida_simple_xx() API</title>
<updated>2024-06-12T09:12:26+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2023-12-19T05:01:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b596340b8552b2eeb2f8f15a07766ea01123cc8e'/>
<id>urn:sha1:b596340b8552b2eeb2f8f15a07766ea01123cc8e</id>
<content type='text'>
[ Upstream commit d8407f71ebeaeb6f50bd89791837873e44609708 ]

ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

This is less verbose.

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Link: https://lore.kernel.org/r/ba9da12fdd5cdb2c28180b7160af5042447d803f.1702962092.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: fbf740aeb86a ("ppdev: Add an error check in register_device")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>random: handle creditable entropy from atomic process context</title>
<updated>2024-04-27T15:11:30+00:00</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2024-04-17T11:38:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=998f52a860555a9f02242bc0a4b3e9b47d47dc11'/>
<id>urn:sha1:998f52a860555a9f02242bc0a4b3e9b47d47dc11</id>
<content type='text'>
commit e871abcda3b67d0820b4182ebe93435624e9c6a4 upstream.

The entropy accounting changes a static key when the RNG has
initialized, since it only ever initializes once. Static key changes,
however, cannot be made from atomic context, so depending on where the
last creditable entropy comes from, the static key change might need to
be deferred to a worker.

Previously the code used the execute_in_process_context() helper
function, which accounts for whether or not the caller is
in_interrupt(). However, that doesn't account for the case where the
caller is actually in process context but is holding a spinlock.

This turned out to be the case with input_handle_event() in
drivers/input/input.c contributing entropy:

  [&lt;ffffffd613025ba0&gt;] die+0xa8/0x2fc
  [&lt;ffffffd613027428&gt;] bug_handler+0x44/0xec
  [&lt;ffffffd613016964&gt;] brk_handler+0x90/0x144
  [&lt;ffffffd613041e58&gt;] do_debug_exception+0xa0/0x148
  [&lt;ffffffd61400c208&gt;] el1_dbg+0x60/0x7c
  [&lt;ffffffd61400c000&gt;] el1h_64_sync_handler+0x38/0x90
  [&lt;ffffffd613011294&gt;] el1h_64_sync+0x64/0x6c
  [&lt;ffffffd613102d88&gt;] __might_resched+0x1fc/0x2e8
  [&lt;ffffffd613102b54&gt;] __might_sleep+0x44/0x7c
  [&lt;ffffffd6130b6eac&gt;] cpus_read_lock+0x1c/0xec
  [&lt;ffffffd6132c2820&gt;] static_key_enable+0x14/0x38
  [&lt;ffffffd61400ac08&gt;] crng_set_ready+0x14/0x28
  [&lt;ffffffd6130df4dc&gt;] execute_in_process_context+0xb8/0xf8
  [&lt;ffffffd61400ab30&gt;] _credit_init_bits+0x118/0x1dc
  [&lt;ffffffd6138580c8&gt;] add_timer_randomness+0x264/0x270
  [&lt;ffffffd613857e54&gt;] add_input_randomness+0x38/0x48
  [&lt;ffffffd613a80f94&gt;] input_handle_event+0x2b8/0x490
  [&lt;ffffffd613a81310&gt;] input_event+0x6c/0x98

According to Guoyong, it's not really possible to refactor the various
drivers to never hold a spinlock there. And in_atomic() isn't reliable.

So, rather than trying to be too fancy, just punt the change in the
static key to a workqueue always. There's basically no drawback of doing
this, as the code already needed to account for the static key not
changing immediately, and given that it's just an optimization, there's
not exactly a hurry to change the static key right away, so deferal is
fine.

Reported-by: Guoyong Wang &lt;guoyong.wang@mediatek.com&gt;
Cc: stable@vger.kernel.org
Fixes: f5bda35fba61 ("random: use static branch for crng_ready()")
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tpm,tpm_tis: Avoid warning splat at shutdown</title>
<updated>2024-04-03T13:28:31+00:00</updated>
<author>
<name>Lino Sanfilippo</name>
<email>l.sanfilippo@kunbus.com</email>
</author>
<published>2024-02-01T11:36:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1d7317d5b636e7816abe7103211741f5bdbdfd2c'/>
<id>urn:sha1:1d7317d5b636e7816abe7103211741f5bdbdfd2c</id>
<content type='text'>
[ Upstream commit b7ab4bbd0188f3985b821fa09456b11105a8dedf ]

If interrupts are not activated the work struct 'free_irq_work' is not
initialized. This results in a warning splat at module shutdown.

Fix this by always initializing the work regardless of whether interrupts
are activated or not.

cc: stable@vger.kernel.org
Fixes: 481c2d14627d ("tpm,tpm_tis: Disable interrupts after 1000 unhandled IRQs")
Reported-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Closes: https://lore.kernel.org/all/CX32RFOMJUQ0.3R4YCL9MDCB96@kernel.org/
Signed-off-by: Lino Sanfilippo &lt;l.sanfilippo@kunbus.com&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>hwrng: starfive - Fix dev_err_probe return error</title>
<updated>2024-02-05T20:14:16+00:00</updated>
<author>
<name>Jia Jie Ho</name>
<email>jiajie.ho@starfivetech.com</email>
</author>
<published>2023-11-20T15:11:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b0af4adaedc6e82501aa4bdf5211a251950fec37'/>
<id>urn:sha1:b0af4adaedc6e82501aa4bdf5211a251950fec37</id>
<content type='text'>
[ Upstream commit 2d37b3649c412b3bcecfea932cb677f7a5775b15 ]

Current dev_err_probe will return 0 instead of proper error code if
driver failed to get irq number. Fix the return err code.

Signed-off-by: Jia Jie Ho &lt;jiajie.ho@starfivetech.com&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reported-by: Dan Carpenter &lt;error27@gmail.com&gt;
Closes: https://lore.kernel.org/r/202311160649.3GhKCfhd-lkp@intel.com/
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: core - Fix page fault dead lock on mmap-ed hwrng</title>
<updated>2024-02-01T00:18:50+00:00</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2023-12-02T01:01:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ecabe8cd456d3bf81e92c53b074732f3140f170d'/>
<id>urn:sha1:ecabe8cd456d3bf81e92c53b074732f3140f170d</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>parisc/agp: Use 64-bit LE values in SBA IOMMU PDIR table</title>
<updated>2023-11-28T17:20:00+00:00</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2023-10-18T17:24:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cb07cb22f9792b47ac28a5cfed973b0129566203'/>
<id>urn:sha1:cb07cb22f9792b47ac28a5cfed973b0129566203</id>
<content type='text'>
commit 86bb854d134f4429feb35d2e05f55c6e036770d2 upstream.

The PDIR table of the System Bus Adapter (SBA) I/O MMU uses 64-bit
little-endian pointers.

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Cc: stable@vger.kernel.org # v6.4+
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>hwrng: geode - fix accessing registers</title>
<updated>2023-11-20T10:59:18+00:00</updated>
<author>
<name>Jonas Gorski</name>
<email>jonas.gorski@gmail.com</email>
</author>
<published>2023-09-10T08:34:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d84a038fa4b3073f5045006ed5b8d8eff30de4dc'/>
<id>urn:sha1:d84a038fa4b3073f5045006ed5b8d8eff30de4dc</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>
</feed>
