<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/char, branch v6.6.32</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.6.32</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.6.32'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2024-04-27T15:11:30Z</updated>
<entry>
<title>random: handle creditable entropy from atomic process context</title>
<updated>2024-04-27T15:11:30Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2024-04-17T11:38:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/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:31Z</updated>
<author>
<name>Lino Sanfilippo</name>
<email>l.sanfilippo@kunbus.com</email>
</author>
<published>2024-02-01T11:36:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/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:16Z</updated>
<author>
<name>Jia Jie Ho</name>
<email>jiajie.ho@starfivetech.com</email>
</author>
<published>2023-11-20T15:11:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/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:50Z</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=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:00Z</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2023-10-18T17:24:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/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:18Z</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=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>
<entry>
<title>hwrng: bcm2835 - Fix hwrng throughput regression</title>
<updated>2023-11-20T10:59:18Z</updated>
<author>
<name>Stefan Wahren</name>
<email>wahrenst@gmx.net</email>
</author>
<published>2023-09-05T23:27:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d0f3994c6a40bcdcf8a2e3ce9b4653e323a44335'/>
<id>urn:sha1:d0f3994c6a40bcdcf8a2e3ce9b4653e323a44335</id>
<content type='text'>
[ Upstream commit b58a36008bfa1aadf55f516bcbfae40c779eb54b ]

The last RCU stall fix caused a massive throughput regression of the
hwrng on Raspberry Pi 0 - 3. hwrng_msleep doesn't sleep precisely enough
and usleep_range doesn't allow scheduling. So try to restore the
best possible throughput by introducing hwrng_yield which interruptable
sleeps for one jiffy.

Some performance measurements on Raspberry Pi 3B+ (arm64/defconfig):

sudo dd if=/dev/hwrng of=/dev/null count=1 bs=10000

cpu_relax              ~138025 Bytes / sec
hwrng_msleep(1000)         ~13 Bytes / sec
hwrng_yield              ~2510 Bytes / sec

Fixes: 96cb9d055445 ("hwrng: bcm2835 - use hwrng_msleep() instead of cpu_relax()")
Link: https://lore.kernel.org/linux-arm-kernel/bc97ece5-44a3-4c4e-77da-2db3eb66b128@gmx.net/
Signed-off-by: Stefan Wahren &lt;wahrenst@gmx.net&gt;
Reviewed-by: Jason A. Donenfeld &lt;Jason@zx2c4.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>Merge tag 'tpmdd-v6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd</title>
<updated>2023-09-13T18:44:20Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-09-13T18:44:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=23f108dc9ed26100b1489f6a9e99088d4064f56b'/>
<id>urn:sha1:23f108dc9ed26100b1489f6a9e99088d4064f56b</id>
<content type='text'>
Pull tpm fix from Jarkko Sakkinen.

* tag 'tpmdd-v6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd:
  tpm: Fix typo in tpmrm class definition
</content>
</entry>
<entry>
<title>Merge tag 'parisc-for-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux</title>
<updated>2023-09-13T18:35:53Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-09-13T18:35:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=847165d7c83ddb32aefab3ad4e7424fad919eb05'/>
<id>urn:sha1:847165d7c83ddb32aefab3ad4e7424fad919eb05</id>
<content type='text'>
Pull parisc architecture fixes from Helge Deller:

 - fix reference to exported symbols for parisc64 [Masahiro Yamada]

 - Block-TLB (BTLB) support on 32-bit CPUs

 - sparse and build-warning fixes

* tag 'parisc-for-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  linux/export: fix reference to exported functions for parisc64
  parisc: BTLB: Initialize BTLB tables at CPU startup
  parisc: firmware: Simplify calling non-PA20 functions
  parisc: BTLB: _edata symbol has to be page aligned for BTLB support
  parisc: BTLB: Add BTLB insert and purge firmware function wrappers
  parisc: BTLB: Clear possibly existing BTLB entries
  parisc: Prepare for Block-TLB support on 32-bit kernel
  parisc: shmparam.h: Document aliasing requirements of PA-RISC
  parisc: irq: Make irq_stack_union static to avoid sparse warning
  parisc: drivers: Fix sparse warning
  parisc: iosapic.c: Fix sparse warnings
  parisc: ccio-dma: Fix sparse warnings
  parisc: sba-iommu: Fix sparse warnigs
  parisc: sba: Fix compile warning wrt list of SBA devices
  parisc: sba_iommu: Fix build warning if procfs if disabled
</content>
</entry>
<entry>
<title>tpm: Fix typo in tpmrm class definition</title>
<updated>2023-09-12T20:07:37Z</updated>
<author>
<name>Justin M. Forbes</name>
<email>jforbes@fedoraproject.org</email>
</author>
<published>2023-09-12T17:02:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ea72883a3bf11fb09dd1ad4f8328cc040263881a'/>
<id>urn:sha1:ea72883a3bf11fb09dd1ad4f8328cc040263881a</id>
<content type='text'>
Commit d2e8071bed0be ("tpm: make all 'class' structures const")
unfortunately had a typo for the name on tpmrm.

Fixes: d2e8071bed0b ("tpm: make all 'class' structures const")
Signed-off-by: Justin M. Forbes &lt;jforbes@fedoraproject.org&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
</content>
</entry>
</feed>
