When an invalid (non existing) handle is used in a TPM command,
that uses the resource manager interface (/dev/tpmrm0) the resource
manager tries to load it from its internal cache, but fails and
the tpm_dev_transmit returns an -EINVAL error to the caller.
The existing async handler doesn't handle these error cases
currently and the condition in the poll handler never returns
mask with EPOLLIN set.
The result is that the poll call blocks and the application gets stuck
until the user_read_timer wakes it up after 120 sec.
Change the tpm_dev_async_work function to handle error conditions
returned from tpm_dev_transmit they are also reflected in the poll mask
and a correct error code could passed back to the caller.
Cc: Jarkko Sakkinen <jarkko(a)kernel.org>
Cc: Jason Gunthorpe <jgg(a)ziepe.ca>
Cc: <linux-integrity(a)vger.kernel.org>
Cc: <stable(a)vger.kernel.org>
Cc: <linux-kernel(a)vger.kernel.org>
Fixes: 9e1b74a63f77 ("tpm: add support for nonblocking operation")
Signed-off-by: Tadeusz Struk <tstruk(a)gmail.com>
---
Changed in v2:
- Updated commit message with better problem description
- Fixed typeos.
Changed in v3:
- Added a comment to tpm_dev_async_work.
- Updated commit message.
---
drivers/char/tpm/tpm-dev-common.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/char/tpm/tpm-dev-common.c b/drivers/char/tpm/tpm-dev-common.c
index c08cbb306636..50df8f09ff79 100644
--- a/drivers/char/tpm/tpm-dev-common.c
+++ b/drivers/char/tpm/tpm-dev-common.c
@@ -69,7 +69,13 @@ static void tpm_dev_async_work(struct work_struct *work)
ret = tpm_dev_transmit(priv->chip, priv->space, priv->data_buffer,
sizeof(priv->data_buffer));
tpm_put_ops(priv->chip);
- if (ret > 0) {
+
+ /*
+ * If ret is > 0 then tpm_dev_transmit returned the size of the
+ * response. If ret is < 0 then tpm_dev_transmit failed and
+ * returned a return code.
+ */
+ if (ret != 0) {
priv->response_length = ret;
mod_timer(&priv->user_read_timer, jiffies + (120 * HZ));
}
--
2.30.2
Good Day My Good Friend
Let me start by introducing myself I am Mr. John Mark from Burkina
Faso, I am writing you this letter based on latest development in my
bank which i we like to bring you in. The sum of Ten Million Five
Hundred Thousand United State Dollars ($ 10.5Million) this is
legitimate Transition after the transfer we will share it, 50% for me
and 50% for you. Let me know if your interested in the deal kindly
Contact me for more details
Kind Regards
Mr.Mark John +226 78531 732
This is the start of the stable review cycle for the 5.15.15 release.
There are 41 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sun, 16 Jan 2022 08:15:33 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.15-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.15.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.15.15-rc1
Arnd Bergmann <arnd(a)arndb.de>
staging: greybus: fix stack size warning with UBSAN
Nathan Chancellor <nathan(a)kernel.org>
drm/i915: Avoid bitwise vs logical OR warning in snb_wm_latency_quirk()
Nathan Chancellor <nathan(a)kernel.org>
staging: wlan-ng: Avoid bitwise vs logical OR warning in hfa384x_usb_throttlefn()
Ricardo Ribalda <ribalda(a)chromium.org>
media: Revert "media: uvcvideo: Set unique vdev name based in type"
Alex Hung <alex.hung(a)canonical.com>
platform/x86/intel: hid: add quirk to support Surface Go 3
Dominik Brodowski <linux(a)dominikbrodowski.net>
random: fix crash on multiple early calls to add_bootloader_randomness()
Eric Biggers <ebiggers(a)google.com>
random: fix data race on crng init time
Eric Biggers <ebiggers(a)google.com>
random: fix data race on crng_node_pool
Brian Silverman <brian.silverman(a)bluerivertech.com>
can: gs_usb: gs_can_start_xmit(): zero-initialize hf->{flags,reserved}
Marc Kleine-Budde <mkl(a)pengutronix.de>
can: isotp: convert struct tpcon::{idx,len} to unsigned int
Marc Kleine-Budde <mkl(a)pengutronix.de>
can: gs_usb: fix use of uninitialized variable, detach device on reception of invalid USB data
Borislav Petkov <bp(a)suse.de>
x86/mce: Remove noinstr annotation from mce_setup()
Andy Shevchenko <andriy.shevchenko(a)linux.intel.com>
mfd: intel-lpss: Fix too early PM enablement in the ACPI ->probe()
Daniel Borkmann <daniel(a)iogearbox.net>
veth: Do not record rx queue hint in veth_xmit
Aditya Garg <gargaditya08(a)live.com>
Bluetooth: btbcm: disable read tx power for MacBook Air 8,1 and 8,2
Aditya Garg <gargaditya08(a)live.com>
Bluetooth: btbcm: disable read tx power for some Macs with the T2 Security chip
Aditya Garg <gargaditya08(a)live.com>
Bluetooth: add quirk disabling LE Read Transmit Power
Adrian Hunter <adrian.hunter(a)intel.com>
mmc: sdhci-pci: Add PCI ID for Intel ADL
Sven Eckelmann <sven(a)narfation.org>
ath11k: Fix buffer overflow when scanning with extraie
Alan Stern <stern(a)rowland.harvard.edu>
USB: Fix "slab-out-of-bounds Write" bug in usb_hcd_poll_rh_status
Alan Stern <stern(a)rowland.harvard.edu>
USB: core: Fix bug in resuming hub's handling of wakeup requests
Paul Cercueil <paul(a)crapouillou.net>
ARM: dts: exynos: Fix BCM4330 Bluetooth reset polarity in I9100
Johan Hovold <johan(a)kernel.org>
Bluetooth: bfusb: fix division by zero in send path
Aaron Ma <aaron.ma(a)canonical.com>
Bluetooth: btusb: Add support for Foxconn QCA 0xe0d0
Tedd Ho-Jeong An <tedd.an(a)intel.com>
Bluetooth: btintel: Fix broken LED quirk for legacy ROM devices
Aaron Ma <aaron.ma(a)canonical.com>
Bluetooth: btusb: Add support for Foxconn MT7922A
Zijun Hu <quic_zijuhu(a)quicinc.com>
Bluetooth: btusb: Add two more Bluetooth parts for WCN6855
Zijun Hu <quic_zijuhu(a)quicinc.com>
Bluetooth: btusb: Add one more Bluetooth part for WCN6855
Linus Torvalds <torvalds(a)linux-foundation.org>
fget: clarify and improve __fget_files() implementation
tjiang(a)codeaurora.org <tjiang(a)codeaurora.org>
Bluetooth: btusb: Add the new support IDs for WCN6855
Larry Finger <Larry.Finger(a)lwfinger.net>
Bluetooth: btusb: Add one more Bluetooth part for the Realtek RTL8852AE
mark-yw.chen <mark-yw.chen(a)mediatek.com>
Bluetooth: btusb: enable Mediatek to support AOSP extension
Mark-YW.Chen <mark-yw.chen(a)mediatek.com>
Bluetooth: btusb: fix memory leak in btusb_mtk_submit_wmt_recv_urb()
Larry Finger <Larry.Finger(a)lwfinger.net>
Bbluetooth: btusb: Add another Bluetooth part for Realtek 8852AE
mark-yw.chen <mark-yw.chen(a)mediatek.com>
Bluetooth: btusb: Add support for IMC Networks Mediatek Chip(MT7921)
Max Chou <max.chou(a)realtek.com>
Bluetooth: btusb: Add the new support ID for Realtek RTL8852A
mark-yw.chen <mark-yw.chen(a)mediatek.com>
Bluetooth: btusb: Add protocol for MediaTek bluetooth devices(MT7922)
Daniel Borkmann <daniel(a)iogearbox.net>
bpf: Fix out of bounds access from invalid *_or_null type verification
Martin Kaiser <martin(a)kaiser.cx>
staging: r8188eu: switch the led off during deinit
Frederic Weisbecker <frederic(a)kernel.org>
workqueue: Fix unbind_workers() VS wq_worker_running() race
Alexander Egorenkov <egorenar(a)linux.ibm.com>
s390/kexec: handle R_390_PLT32DBL rela in arch_kexec_apply_relocations_add()
-------------
Diffstat:
Makefile | 4 +-
arch/arm/boot/dts/exynos4210-i9100.dts | 2 +-
arch/s390/kernel/machine_kexec_file.c | 4 ++
arch/x86/kernel/cpu/mce/core.c | 26 +++++--
drivers/bluetooth/bfusb.c | 3 +
drivers/bluetooth/btbcm.c | 51 ++++++++++++++
drivers/bluetooth/btintel.c | 20 +++---
drivers/bluetooth/btintel.h | 2 +-
drivers/bluetooth/btusb.c | 61 ++++++++++++++--
drivers/char/random.c | 117 ++++++++++++++++++-------------
drivers/gpu/drm/i915/intel_pm.c | 6 +-
drivers/media/usb/uvc/uvc_driver.c | 7 +-
drivers/mfd/intel-lpss-acpi.c | 7 +-
drivers/mmc/host/sdhci-pci-core.c | 1 +
drivers/mmc/host/sdhci-pci.h | 1 +
drivers/net/can/usb/gs_usb.c | 5 +-
drivers/net/veth.c | 1 -
drivers/net/wireless/ath/ath11k/wmi.c | 6 +-
drivers/platform/x86/intel/hid.c | 7 ++
drivers/staging/greybus/audio_topology.c | 92 ++++++++++++------------
drivers/staging/r8188eu/core/rtw_led.c | 1 +
drivers/staging/wlan-ng/hfa384x_usb.c | 22 +++---
drivers/usb/core/hcd.c | 9 ++-
drivers/usb/core/hub.c | 2 +-
fs/file.c | 72 ++++++++++++++-----
include/net/bluetooth/hci.h | 9 +++
kernel/bpf/verifier.c | 6 +-
kernel/workqueue.c | 9 +++
net/bluetooth/hci_core.c | 3 +-
net/can/isotp.c | 4 +-
30 files changed, 389 insertions(+), 171 deletions(-)
This is the start of the stable review cycle for the 5.16.1 release.
There are 37 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sun, 16 Jan 2022 08:15:33 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.16.1-rc1…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.16.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.16.1-rc1
Helge Deller <deller(a)gmx.de>
parisc: Fix pdc_toc_pim_11 and pdc_toc_pim_20 definitions
Arnd Bergmann <arnd(a)arndb.de>
staging: greybus: fix stack size warning with UBSAN
Nathan Chancellor <nathan(a)kernel.org>
drm/i915: Avoid bitwise vs logical OR warning in snb_wm_latency_quirk()
Ricardo Ribalda <ribalda(a)chromium.org>
media: Revert "media: uvcvideo: Set unique vdev name based in type"
Alex Hung <alex.hung(a)canonical.com>
platform/x86/intel: hid: add quirk to support Surface Go 3
Dominik Brodowski <linux(a)dominikbrodowski.net>
random: fix crash on multiple early calls to add_bootloader_randomness()
Eric Biggers <ebiggers(a)google.com>
random: fix data race on crng init time
Eric Biggers <ebiggers(a)google.com>
random: fix data race on crng_node_pool
Brian Silverman <brian.silverman(a)bluerivertech.com>
can: gs_usb: gs_can_start_xmit(): zero-initialize hf->{flags,reserved}
Marc Kleine-Budde <mkl(a)pengutronix.de>
can: isotp: convert struct tpcon::{idx,len} to unsigned int
Marc Kleine-Budde <mkl(a)pengutronix.de>
can: gs_usb: fix use of uninitialized variable, detach device on reception of invalid USB data
Orlando Chamberlain <redecorating(a)protonmail.com>
mfd: intel-lpss-pci: Fix clock speed for 38a8 UART
Andy Shevchenko <andriy.shevchenko(a)linux.intel.com>
mfd: intel-lpss: Fix too early PM enablement in the ACPI ->probe()
Daniel Borkmann <daniel(a)iogearbox.net>
veth: Do not record rx queue hint in veth_xmit
Aditya Garg <gargaditya08(a)live.com>
Bluetooth: btbcm: disable read tx power for MacBook Air 8,1 and 8,2
Aditya Garg <gargaditya08(a)live.com>
Bluetooth: btbcm: disable read tx power for some Macs with the T2 Security chip
Aditya Garg <gargaditya08(a)live.com>
Bluetooth: add quirk disabling LE Read Transmit Power
Adrian Hunter <adrian.hunter(a)intel.com>
mmc: sdhci-pci: Add PCI ID for Intel ADL
Sven Eckelmann <sven(a)narfation.org>
ath11k: Fix buffer overflow when scanning with extraie
Alan Stern <stern(a)rowland.harvard.edu>
USB: Fix "slab-out-of-bounds Write" bug in usb_hcd_poll_rh_status
Alan Stern <stern(a)rowland.harvard.edu>
USB: core: Fix bug in resuming hub's handling of wakeup requests
Paul Cercueil <paul(a)crapouillou.net>
ARM: dts: exynos: Fix BCM4330 Bluetooth reset polarity in I9100
Johan Hovold <johan(a)kernel.org>
Bluetooth: bfusb: fix division by zero in send path
Aaron Ma <aaron.ma(a)canonical.com>
Bluetooth: btusb: Add support for Foxconn QCA 0xe0d0
Tedd Ho-Jeong An <tedd.an(a)intel.com>
Bluetooth: btintel: Fix broken LED quirk for legacy ROM devices
Aaron Ma <aaron.ma(a)canonical.com>
Bluetooth: btusb: Add support for Foxconn MT7922A
Zijun Hu <quic_zijuhu(a)quicinc.com>
Bluetooth: btusb: Add two more Bluetooth parts for WCN6855
Zijun Hu <quic_zijuhu(a)quicinc.com>
Bluetooth: btusb: Add one more Bluetooth part for WCN6855
tjiang(a)codeaurora.org <tjiang(a)codeaurora.org>
Bluetooth: btusb: Add the new support IDs for WCN6855
mark-yw.chen <mark-yw.chen(a)mediatek.com>
Bluetooth: btusb: enable Mediatek to support AOSP extension
Mark-YW.Chen <mark-yw.chen(a)mediatek.com>
Bluetooth: btusb: fix memory leak in btusb_mtk_submit_wmt_recv_urb()
David Yang <davidcomponentone(a)gmail.com>
Bluetooth: btusb: Fix application of sizeof to pointer
Larry Finger <Larry.Finger(a)lwfinger.net>
Bluetooth: btusb: Add one more Bluetooth part for the Realtek RTL8852AE
Daniel Borkmann <daniel(a)iogearbox.net>
bpf: Fix out of bounds access from invalid *_or_null type verification
Martin Kaiser <martin(a)kaiser.cx>
staging: r8188eu: switch the led off during deinit
Frederic Weisbecker <frederic(a)kernel.org>
workqueue: Fix unbind_workers() VS wq_worker_sleeping() race
Frederic Weisbecker <frederic(a)kernel.org>
workqueue: Fix unbind_workers() VS wq_worker_running() race
-------------
Diffstat:
Makefile | 4 +-
arch/arm/boot/dts/exynos4210-i9100.dts | 2 +-
arch/parisc/include/uapi/asm/pdc.h | 32 ++++++---
drivers/bluetooth/bfusb.c | 3 +
drivers/bluetooth/btbcm.c | 51 ++++++++++++++
drivers/bluetooth/btintel.c | 20 +++---
drivers/bluetooth/btintel.h | 2 +-
drivers/bluetooth/btusb.c | 49 +++++++++++--
drivers/char/random.c | 117 ++++++++++++++++++-------------
drivers/gpu/drm/i915/intel_pm.c | 6 +-
drivers/media/usb/uvc/uvc_driver.c | 7 +-
drivers/mfd/intel-lpss-acpi.c | 7 +-
drivers/mfd/intel-lpss-pci.c | 2 +-
drivers/mmc/host/sdhci-pci-core.c | 1 +
drivers/mmc/host/sdhci-pci.h | 1 +
drivers/net/can/usb/gs_usb.c | 5 +-
drivers/net/veth.c | 1 -
drivers/net/wireless/ath/ath11k/wmi.c | 6 +-
drivers/platform/x86/intel/hid.c | 7 ++
drivers/staging/greybus/audio_topology.c | 92 ++++++++++++------------
drivers/staging/r8188eu/core/rtw_led.c | 1 +
drivers/usb/core/hcd.c | 9 ++-
drivers/usb/core/hub.c | 2 +-
include/net/bluetooth/hci.h | 9 +++
kernel/bpf/verifier.c | 6 +-
kernel/workqueue.c | 19 +++++
net/bluetooth/hci_core.c | 3 +-
net/can/isotp.c | 4 +-
28 files changed, 323 insertions(+), 145 deletions(-)