Skip to content

[LTS 8.6] imon: CVE-2025-39993, kvm: CVE-2026-23401, CVE-2023-30456, CVE-2022-45869, CVE-2022-1852#1356

Open
pvts-mat wants to merge 9 commits into
ctrliq:ciqlts8_6from
pvts-mat:CVE-batch-36_ciqlts8_6
Open

[LTS 8.6] imon: CVE-2025-39993, kvm: CVE-2026-23401, CVE-2023-30456, CVE-2022-45869, CVE-2022-1852#1356
pvts-mat wants to merge 9 commits into
ctrliq:ciqlts8_6from
pvts-mat:CVE-batch-36_ciqlts8_6

Conversation

@pvts-mat

@pvts-mat pvts-mat commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

[LTS 8.6]

CVE-2022-1852 VULN-3154
CVE-2022-45869 VULN-3954
CVE-2023-30456 VULN-3974
CVE-2025-39993 VULN-158816
CVE-2026-23401 VULN-180393

Commits

CVE-2022-1852

KVM: x86: avoid calling x86 emulator without a decoded instruction

jira VULN-3154
cve CVE-2022-1852
commit-author Sean Christopherson <seanjc@google.com>
commit fee060cd52d69c114b62d1a2948ea9648b5131f9

CVE-2022-45869

KVM: x86/mmu: Fix race condition in direct_page_fault

jira VULN-3954
cve CVE-2022-45869
commit-author Kazuki Takiguchi <takiguchi.kazuki171@gmail.com>
commit 47b0c2e4c220f2251fd8dcfbb44479819c715e15
upstream-diff Used linux-5.15.y backport
  f88a6977f8b981bfb5fddd18fbaa75e57e8af293 for the clean pick. The
  modified function `direct_page_fault' is the same in both versions

CVE-2023-30456

KVM: nVMX: add missing consistency checks for CR0 and CR4

jira VULN-3974
cve CVE-2023-30456
commit-author Paolo Bonzini <pbonzini@redhat.com>
commit 112e66017bff7f2837030f34c2bc19501e9212d5

CVE-2025-39993

0:

media: rc: fix races with imon_disconnect()

jira VULN-158816
cve CVE-2025-39993
commit-author Larshin Sergey <Sergey.Larshin@kaspersky.com>
commit fa0f61cc1d828178aa921475a9b786e7fbb65ccb

1:

media: imon: grab lock earlier in imon_ir_change_protocol()

jira VULN-158816
cve-pre CVE-2025-39993
commit-author Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
commit 7019553ab850ce1d3f0e512e16d14ab153f91c04

2:

media: imon: Fix race getting ictx->lock

jira VULN-158816
cve-pre CVE-2025-39993
commit-author Ricardo Ribalda <ribalda@chromium.org>
commit 24147897507cd3a7d63745d1518a638bf4132238

3:

media: imon: fix a race condition in send_packet()

jira VULN-158816
cve-pre CVE-2025-39993
commit-author Gautam Menghani <gautammenghani201@gmail.com>
commit 813ceef062b53d68f296aa3cb944b21a091fabdb

4:

media: imon: reorganize serialization

jira VULN-158816
cve-pre CVE-2025-39993
commit-author Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
commit db264d4c66c0fe007b5d19fd007707cd0697603d
upstream-diff Context conflict solved due to missing
  cf330691668a3bee37b8ac8212709b3ccdd87997 ("media: rc: Add support for
  another iMON 0xffdc device")

The imon module had a bunch of synchronization fixes building one upon the other. This batch of prerequisites follows the general pattern found in other versions having CVE-2025-39993 fix backported:

   File
   -----------------------
   drivers/media/rc/imon.c
   
   kernel-mainline                                                                        ciqlts8_6               linux-5.4.y             linux-5.10.y            linux-6.1.y             linux-6.6.y             linux-6.12.y            linux-5.15.y            linux-6.16.y
   -------------------------------------------------------------------------------------  ----------------------  ----------------------  ----------------------  ----------------------  ----------------------  ----------------------  ----------------------  ----------------------
   88796a18f20f0a9 media: imon: drop redundant device references
   dccc0c3ddf8f160 media: rc: fix race between unregister and urb/irq callbacks
   bf4afc53b77aeaa Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
   69050f8d6d075dc treewide: Replace kmalloc with kmalloc_obj for non-scalar types
0: fa0f61cc1d82817 media: rc: fix races with imon_disconnect()                                                    ~ 934897600 2025-10-29  ~ b03fac6e2 2025-10-29  ~ 71096a616 2025-10-15  ~ 71da40648 2025-10-06  ~ fd5d3e6b1 2025-10-06  ~ 71c52b073 2025-10-19  ~ d9f6ce996 2025-10-06
   a75b8d198c55e9e media: imon: Remove unused defines
1: 7019553ab850ce1 media: imon: grab lock earlier in imon_ir_change_protocol()                                    ~ e1b1ba186 2025-10-29
   eecd203ada43a46 media: imon: make send_packet() more robust                                                    ~ 519737af1 2025-12-03  ~ f58ab83b7 2025-12-07  ~ 667afd468 2025-12-07  ~ 8231e8011 2025-11-24  ~ 0213e4175 2025-11-13  ~ 26f6a1dd5 2025-12-07
   41cb08555c41649 treewide, timers: Rename from_timer() to timer_container_of()                                                                                                                                                                                  = 41cb08555 2025-06-08
   8fa7292fee5c524 treewide: Switch/rename to timer_delete[_sync]()                                                                                                                                                                                               = 8fa7292fe 2025-04-05
2: 24147897507cd3a media: imon: Fix race getting ictx->lock                                                       ~ 031eda178 2024-08-19  ~ f3968b3d3 2024-08-19  ~ 2e13203b8 2024-08-03  ~ ff64b8197 2024-08-03  = 241478975 2024-05-31  ~ 477799870 2024-08-19  = 241478975 2024-05-31
   cc4cce95a95be82 media: imon: Convert sprintf/snprintf to sysfs_emit                                                                                                                                            = cc4cce95a 2024-03-25                          = cc4cce95a 2024-03-25
   a1766a4fd83befa media: imon: fix access to invalid resource for the second interface                                                   ~ 0f5068519 2023-11-28  ~ b083aaf5d 2023-11-28  ~ 2a493a34b 2023-11-28  = a1766a4fd 2023-10-07  ~ 5e0b788fb 2023-11-28  = a1766a4fd 2023-10-07
3: 813ceef062b53d6 media: imon: fix a race condition in send_packet()                                             ~ 1d8521e11 2023-01-18  ~ dabf7b675 2023-01-14  ~ 3f8b24ab0 2022-12-31  = 813ceef06 2022-11-25  = 813ceef06 2022-11-25  ~ bffc80bac 2022-12-31  = 813ceef06 2022-11-25
   2dfe2c4f1720b6b media: imon: Remove the unneeded result variable                                                                                               = 2dfe2c4f1 2022-09-24  = 2dfe2c4f1 2022-09-24  = 2dfe2c4f1 2022-09-24                          = 2dfe2c4f1 2022-09-24
4: db264d4c66c0fe0 media: imon: reorganize serialization                                                          ~ ab5d16511 2025-10-29  ~ 4cf6ba936 2022-06-09  = db264d4c6 2022-05-13  = db264d4c6 2022-05-13  = db264d4c6 2022-05-13  ~ 32c7b04d5 2022-06-09  = db264d4c6 2022-05-13
   af2aa3c4e52bc63 media: imon: drop references only after device is no longer used                                                                               = af2aa3c4e 2022-05-13  = af2aa3c4e 2022-05-13  = af2aa3c4e 2022-05-13                          = af2aa3c4e 2022-05-13
   07af64dddfb87d1 media: imon: fix timer racing disconnect                                                                                                       = 07af64ddd 2022-05-13  = 07af64ddd 2022-05-13  = 07af64ddd 2022-05-13                          = 07af64ddd 2022-05-13
   a43617a5bf1b678 media: imon: avoid needless atomic allocations in resume                                                                                       = a43617a5b 2022-05-13  = a43617a5b 2022-05-13  = a43617a5b 2022-05-13                          = a43617a5b 2022-05-13
   c9458c6f8a8f9c8 media: rc: clean the freed urb pointer to avoid double free                                                                                    = c9458c6f8 2021-09-30  = c9458c6f8 2021-09-30  = c9458c6f8 2021-09-30                          = c9458c6f8 2021-09-30
   f1d9f315924f02e media: imon: use DEVICE_ATTR_RW() helper macro                                                                                                 = f1d9f3159 2021-06-08  = f1d9f3159 2021-06-08  = f1d9f3159 2021-06-08  = f1d9f3159 2021-06-08  = f1d9f3159 2021-06-08
   276e2ee0765941e media: imon: Replace http links with https ones                                                                        = 276e2ee07 2020-07-19  = 276e2ee07 2020-07-19  = 276e2ee07 2020-07-19  = 276e2ee07 2020-07-19  = 276e2ee07 2020-07-19  = 276e2ee07 2020-07-19
   f3f5ba42c58d56d media: imon: invalid dereference in imon_touch_event                                           ~ eff2ccdfd 2019-11-29  = f3f5ba42c 2019-10-24  = f3f5ba42c 2019-10-24  = f3f5ba42c 2019-10-24  = f3f5ba42c 2019-10-24  = f3f5ba42c 2019-10-24  = f3f5ba42c 2019-10-24
   cf330691668a3be media: rc: Add support for another iMON 0xffdc device                                          ~ f61cad824 2025-10-29  = cf3306916 2019-10-07  = cf3306916 2019-10-07  = cf3306916 2019-10-07  = cf3306916 2019-10-07  = cf3306916 2019-10-07  = cf3306916 2019-10-07
   b20a6e298bcb8cb media: rc: imon: Allow iMON RC protocol for ffdc 7e device                                     = b20a6e298 2019-08-14  = b20a6e298 2019-08-14  = b20a6e298 2019-08-14  = b20a6e298 2019-08-14  = b20a6e298 2019-08-14  = b20a6e298 2019-08-14  = b20a6e298 2019-08-14
   3cfa958b08a4f81 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 158                             = 3cfa958b0 2019-05-30  = 3cfa958b0 2019-05-30  = 3cfa958b0 2019-05-30  = 3cfa958b0 2019-05-30  = 3cfa958b0 2019-05-30  = 3cfa958b0 2019-05-30  = 3cfa958b0 2019-05-30
   2396e2821b0f42a media: rc: imon: replace strcpy() by strscpy()                                                 = 2396e2821 2018-11-22  = 2396e2821 2018-11-22  = 2396e2821 2018-11-22  = 2396e2821 2018-11-22  = 2396e2821 2018-11-22  = 2396e2821 2018-11-22  = 2396e2821 2018-11-22
   2525fdcb6e8211e media: imon: rename protocol from other to imon                        = 2525fdcb6 2018-03-21  = 2525fdcb6 2018-03-21  = 2525fdcb6 2018-03-21  = 2525fdcb6 2018-03-21  = 2525fdcb6 2018-03-21  = 2525fdcb6 2018-03-21  = 2525fdcb6 2018-03-21  = 2525fdcb6 2018-03-21
   1b450f211e009d2 media: Revert "[media] staging: lirc_imon: port remaining usb ids to   = 1b450f211 2018-03-21  = 1b450f211 2018-03-21  = 1b450f211 2018-03-21  = 1b450f211 2018-03-21  = 1b450f211 2018-03-21  = 1b450f211 2018-03-21  = 1b450f211 2018-03-21  = 1b450f211 2018-03-21
   e607486c4cfcddb media: imon: remove unused function tv2int                             = e607486c4 2017-12-18  = e607486c4 2017-12-18  = e607486c4 2017-12-18  = e607486c4 2017-12-18  = e607486c4 2017-12-18  = e607486c4 2017-12-18  = e607486c4 2017-12-18  = e607486c4 2017-12-18
   6a489f760ea1b78 media: imon: auto-config ffdc 26 device                                = 6a489f760 2017-12-18  = 6a489f760 2017-12-18  = 6a489f760 2017-12-18  = 6a489f760 2017-12-18  = 6a489f760 2017-12-18  = 6a489f760 2017-12-18  = 6a489f760 2017-12-18  = 6a489f760 2017-12-18
   [...]

CVE-2026-23401

KVM: x86/mmu: Drop/zap existing present SPTE even when creating an MMIO SPTE

jira VULN-180393
cve CVE-2026-23401
commit-author Sean Christopherson <seanjc@google.com>
commit aad885e774966e97b675dfe928da164214a71605
upstream-diff Used linux-5.15.y's backport
  20656cd1f243d3a154aac5dd1b823110b6906fe1 for the clean cherry-pick.
  Just like that version the LTS 8.6 misses
  1075d41efd598d3fd4d52a1e1116b20979975135 ("KVM: x86/mmu: Expand and
  clean up page fault stats"). Strictly speaking, the upstream's
  `kvm_flush_remote_tlbs_gfn(vcpu->kvm, gfn, level)' call corresponds to
  LTS 8.6-native `kvm_flush_remote_tlbs_with_address(vcpu->kvm, gfn &
  -KVM_PAGES_PER_HPAGE(level), KVM_PAGES_PER_HPAGE(level))'. See the
  non-backported commits:
  - 9ffe9265375cbaf6c01647e31ae9fee8595b698c ("KVM: x86/mmu: Fix wrong gfn
    range of tlb flushing in kvm_set_pte_rmapp()"),
  - 8c63e8c2176552d5c003d7459609383d32bf47f3 ("KVM: x86/mmu: Rename
    kvm_flush_remote_tlbs_with_address()"),
  - c667a3baeddcc982bf512c126aec8d0f04adecfe ("KVM: x86/mmu: Move
    round_gfn_for_level() helper into mmu_internal.h").
  Nevertheless preserved linux-5.15.y's
  `kvm_flush_remote_tlbs_with_address()' call without `gfn' rounding, as
  that's exactly how it's used in the same function a few lines later,
  strongly suggesting that the issues raised in commit 9ffe92653 don't
  apply here.

For details see the PR for the LTS 9.2 solution with the same situation.

kABI check: passed

[0/1] kabi_check_kernel	Check ABI of kernel [ciqlts8_6-CVE-batch-36]	_kabi_check_kernel__x86_64--test--ciqlts8_6-CVE-batch-36
ninja explain: output state/kernels/ciqlts8_6-CVE-batch-36/x86_64/kabi_checked older than most recent input state/kernels/ciqlts8_6-CVE-batch-36/x86_64/compiled (1781819728816874964 vs 1781827317595394731)
ninja explain: state/kernels/ciqlts8_6-CVE-batch-36/x86_64/kabi_checked is dirty
+ dist_git_version=el-8.6
+ local_version=ciqlts8_6-CVE-batch-36
+ arch=x86_64
+ user=pvts
+ buildmachine=x86_64--build--ciqlts8_6
+ virsh_timeout=600
+ ssh_daemon_wait=20
+ src_dir=/mnt/code/kernel-dist-git-el-8.6
+ build_dir=/mnt/build_files/kernel-src-tree-ciqlts8_6-CVE-batch-36
+ sudo chmod +x /data/src/ctrliq-github-haskell/kernel-dist-git-el-8.6/SOURCES/check-kabi
+ ninja-back/virssh.xsh --max 8 --shutdown-on-success --shutdown-on-failure --timeout 600 --ssh-daemon-wait 20 pvts x86_64--build--ciqlts8_6 ''\''/mnt/code/kernel-dist-git-el-8.6/SOURCES/check-kabi'\'' -k '\''/mnt/code/kernel-dist-git-el-8.6/SOURCES/Module.kabi_x86_64'\'' -s '\''/mnt/build_files/kernel-src-tree-ciqlts8_6-CVE-batch-36/Module.symvers'\'''
kABI check passed
+ touch state/kernels/ciqlts8_6-CVE-batch-36/x86_64/kabi_checked

Boot test: passed

boot-test.log

Kselftests: passed relative

Reference

kselftests–ciqlts8_6–run1.log
kselftests–ciqlts8_6–run2.log
kselftests–ciqlts8_6–run3.log

Patch

kselftests–ciqlts8_6-CVE-batch-36–run1.log
kselftests–ciqlts8_6-CVE-batch-36–run2.log
kselftests–ciqlts8_6-CVE-batch-36–run3.log

Comparison

The tests results for the reference and the patch are the same.

$ ktests.xsh diff -d kselftests*.log
Column    File
--------  --------------------------------------------
Status0   kselftests--ciqlts8_6--run1.log
Status1   kselftests--ciqlts8_6--run2.log
Status2   kselftests--ciqlts8_6--run3.log
Status3   kselftests--ciqlts8_6-CVE-batch-36--run1.log
Status4   kselftests--ciqlts8_6-CVE-batch-36--run2.log
Status5   kselftests--ciqlts8_6-CVE-batch-36--run3.log

full-tests-results-comparison.log

pvts-mat added 9 commits June 21, 2026 19:00
…IO SPTE

jira VULN-180393
cve CVE-2026-23401
commit-author Sean Christopherson <seanjc@google.com>
commit aad885e
upstream-diff Used linux-5.15.y's backport
  20656cd1f243d3a154aac5dd1b823110b6906fe1 for the clean cherry-pick.
  Just like that version the LTS 8.6 misses
  1075d41 ("KVM: x86/mmu: Expand and
  clean up page fault stats"). Strictly speaking, the upstream's
  `kvm_flush_remote_tlbs_gfn(vcpu->kvm, gfn, level)' call corresponds to
  LTS 8.6-native `kvm_flush_remote_tlbs_with_address(vcpu->kvm, gfn &
  -KVM_PAGES_PER_HPAGE(level), KVM_PAGES_PER_HPAGE(level))'. See the
  non-backported commits:
  - 9ffe926 ("KVM: x86/mmu: Fix wrong gfn
    range of tlb flushing in kvm_set_pte_rmapp()"),
  - 8c63e8c ("KVM: x86/mmu: Rename
    kvm_flush_remote_tlbs_with_address()"),
  - c667a3b ("KVM: x86/mmu: Move
    round_gfn_for_level() helper into mmu_internal.h").
  Nevertheless preserved linux-5.15.y's
  `kvm_flush_remote_tlbs_with_address()' call without `gfn' rounding, as
  that's exactly how it's used in the same function a few lines later,
  strongly suggesting that the issues raised in commit 9ffe926 don't
  apply here.

When installing an emulated MMIO SPTE, do so *after* dropping/zapping the
existing SPTE (if it's shadow-present).  While commit a54aa15 was
right about it being impossible to convert a shadow-present SPTE to an
MMIO SPTE due to a _guest_ write, it failed to account for writes to guest
memory that are outside the scope of KVM.

E.g. if host userspace modifies a shadowed gPTE to switch from a memslot
to emulted MMIO and then the guest hits a relevant page fault, KVM will
install the MMIO SPTE without first zapping the shadow-present SPTE.

  ------------[ cut here ]------------
  is_shadow_present_pte(*sptep)
  WARNING: arch/x86/kvm/mmu/mmu.c:484 at mark_mmio_spte+0xb2/0xc0 [kvm], CPU#0: vmx_ept_stale_r/4292
  Modules linked in: kvm_intel kvm irqbypass
  CPU: 0 UID: 1000 PID: 4292 Comm: vmx_ept_stale_r Not tainted 7.0.0-rc2-eafebd2d2ab0-sink-vm ctrliq#319 PREEMPT
  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
  RIP: 0010:mark_mmio_spte+0xb2/0xc0 [kvm]
  Call Trace:
   <TASK>
   mmu_set_spte+0x237/0x440 [kvm]
   ept_page_fault+0x535/0x7f0 [kvm]
   kvm_mmu_do_page_fault+0xee/0x1f0 [kvm]
   kvm_mmu_page_fault+0x8d/0x620 [kvm]
   vmx_handle_exit+0x18c/0x5a0 [kvm_intel]
   kvm_arch_vcpu_ioctl_run+0xc55/0x1c20 [kvm]
   kvm_vcpu_ioctl+0x2d5/0x980 [kvm]
   __x64_sys_ioctl+0x8a/0xd0
   do_syscall_64+0xb5/0x730
   entry_SYSCALL_64_after_hwframe+0x4b/0x53
  RIP: 0033:0x47fa3f
   </TASK>
  ---[ end trace 0000000000000000 ]---

	Reported-by: Alexander Bulekov <bkov@amazon.com>
	Debugged-by: Alexander Bulekov <bkov@amazon.com>
	Suggested-by: Fred Griffoul <fgriffo@amazon.co.uk>
Fixes: a54aa15 ("KVM: x86/mmu: Handle MMIO SPTEs directly in mmu_set_spte()")
	Cc: stable@vger.kernel.org
	Signed-off-by: Sean Christopherson <seanjc@google.com>
(cherry picked from commit 20656cd1f243d3a154aac5dd1b823110b6906fe1)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-158816
cve-pre CVE-2025-39993
commit-author Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
commit db264d4
upstream-diff Context conflict solved due to missing
  cf33069 ("media: rc: Add support for
  another iMON 0xffdc device")

Since usb_register_dev() from imon_init_display() from imon_probe() holds
minor_rwsem while display_open() which holds driver_lock and ictx->lock is
called with minor_rwsem held from usb_open(), holding driver_lock or
ictx->lock when calling usb_register_dev() causes circular locking
dependency problem.

Since usb_deregister_dev() from imon_disconnect() holds minor_rwsem while
display_open() which holds driver_lock is called with minor_rwsem held,
holding driver_lock when calling usb_deregister_dev() also causes circular
locking dependency problem.

Sean Young explained that the problem is there are imon devices which have
two usb interfaces, even though it is one device. The probe and disconnect
function of both usb interfaces can run concurrently.

Alan Stern responded that the driver and USB cores guarantee that when an
interface is probed, both the interface and its USB device are locked.
Ditto for when the disconnect callback gets run. So concurrent probing/
disconnection of multiple interfaces on the same device is not possible.

Therefore, we don't need locks for handling race between imon_probe() and
imon_disconnect(). But we still need to handle race between display_open()
/vfd_write()/lcd_write()/display_close() and imon_disconnect(), for
disconnect event can happen while file descriptors are in use.

Since "struct file"->private_data is set by display_open(), vfd_write()/
lcd_write()/display_close() can assume that "struct file"->private_data
is not NULL even after usb_set_intfdata(interface, NULL) was called.

Replace insufficiently held driver_lock with refcount_t based management.
Add a boolean flag for recording whether imon_disconnect() was already
called. Use RCU for accessing this boolean flag and refcount_t.

Since the boolean flag for imon_disconnect() is shared, disconnect event
on either intf0 or intf1 affects both interfaces. But I assume that this
change does not matter, for usually disconnect event would not happen
while interfaces are in use.

Link: https://syzkaller.appspot.com/bug?extid=c558267ad910fc494497

	Reported-by: syzbot <syzbot+c558267ad910fc494497@syzkaller.appspotmail.com>
	Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
	Tested-by: syzbot <syzbot+c558267ad910fc494497@syzkaller.appspotmail.com>
	Cc: Alan Stern <stern@rowland.harvard.edu>
	Signed-off-by: Sean Young <sean@mess.org>
	Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
(cherry picked from commit db264d4)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-158816
cve-pre CVE-2025-39993
commit-author Gautam Menghani <gautammenghani201@gmail.com>
commit 813ceef

The function send_packet() has a race condition as follows:

func send_packet()
{
    // do work
    call usb_submit_urb()
    mutex_unlock()
    wait_for_event_interruptible()  <-- lock gone
    mutex_lock()
}

func vfd_write()
{
    mutex_lock()
    call send_packet()  <- prev call is not completed
    mutex_unlock()
}

When the mutex is unlocked and the function send_packet() waits for the
call to complete, vfd_write() can start another call, which leads to the
"URB submitted while active" warning in usb_submit_urb().
Fix this by removing the mutex_unlock() call in send_packet() and using
mutex_lock_interruptible().

Link: https://syzkaller.appspot.com/bug?id=e378e6a51fbe6c5cc43e34f131cc9a315ef0337e

Fixes: 21677cf ("V4L/DVB: ir-core: add imon driver")
	Reported-by: syzbot+0c3cb6dc05fbbdc3ad66@syzkaller.appspotmail.com
	Signed-off-by: Gautam Menghani <gautammenghani201@gmail.com>
	Signed-off-by: Sean Young <sean@mess.org>
	Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
(cherry picked from commit 813ceef)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-158816
cve-pre CVE-2025-39993
commit-author Ricardo Ribalda <ribalda@chromium.org>
commit 2414789

Lets fix a race between mutex_is_lock() and mutex_lock().

<-mutex is not locked
if (!mutex_is_locked(&ictx->lock)) {
	unlock = true; <- mutex is locked externaly
	mutex_lock(&ictx->lock);
}

Let's use mutex_trylock() that does mutex_is_lock() and mutex_lock()
atomically.

Fix the following cocci warning:
drivers/media/rc/imon.c:1167:1-7: preceding lock on line 1153

Fixes: 23ef710 ("[media] imon: add conditional locking in change_protocol")
	Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
	Signed-off-by: Sean Young <sean@mess.org>
	Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
(cherry picked from commit 2414789)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-158816
cve-pre CVE-2025-39993
commit-author Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
commit 7019553

Move mutex_trylock() in imon_ir_change_protocol() to the beginning,
for memcpy() which modifies ictx->usb_tx_buf should be protected by
ictx->lock.

Also, verify at the beginning of send_packet() that ictx->lock is held
in case send_packet() is by error called from imon_ir_change_protocol()
when mutex_trylock() failed due to concurrent requests.

	Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
	Signed-off-by: Sean Young <sean@mess.org>
	Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
(cherry picked from commit 7019553)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-158816
cve CVE-2025-39993
commit-author Larshin Sergey <Sergey.Larshin@kaspersky.com>
commit fa0f61c

Syzbot reports a KASAN issue as below:
BUG: KASAN: use-after-free in __create_pipe include/linux/usb.h:1945 [inline]
BUG: KASAN: use-after-free in send_packet+0xa2d/0xbc0 drivers/media/rc/imon.c:627
Read of size 4 at addr ffff8880256fb000 by task syz-executor314/4465

CPU: 2 PID: 4465 Comm: syz-executor314 Not tainted 6.0.0-rc1-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
Call Trace:
 <TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:317 [inline]
print_report.cold+0x2ba/0x6e9 mm/kasan/report.c:433
kasan_report+0xb1/0x1e0 mm/kasan/report.c:495
__create_pipe include/linux/usb.h:1945 [inline]
send_packet+0xa2d/0xbc0 drivers/media/rc/imon.c:627
vfd_write+0x2d9/0x550 drivers/media/rc/imon.c:991
vfs_write+0x2d7/0xdd0 fs/read_write.c:576
ksys_write+0x127/0x250 fs/read_write.c:631
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

The iMON driver improperly releases the usb_device reference in
imon_disconnect without coordinating with active users of the
device.

Specifically, the fields usbdev_intf0 and usbdev_intf1 are not
protected by the users counter (ictx->users). During probe,
imon_init_intf0 or imon_init_intf1 increments the usb_device
reference count depending on the interface. However, during
disconnect, usb_put_dev is called unconditionally, regardless of
actual usage.

As a result, if vfd_write or other operations are still in
progress after disconnect, this can lead to a use-after-free of
the usb_device pointer.

Thread 1 vfd_write                      Thread 2 imon_disconnect
                                        ...
                                        if
                                          usb_put_dev(ictx->usbdev_intf0)
                                        else
                                          usb_put_dev(ictx->usbdev_intf1)
...
while
  send_packet
    if
      pipe = usb_sndintpipe(
        ictx->usbdev_intf0) UAF
    else
      pipe = usb_sndctrlpipe(
        ictx->usbdev_intf0, 0) UAF

Guard access to usbdev_intf0 and usbdev_intf1 after disconnect by
checking ictx->disconnected in all writer paths. Add early return
with -ENODEV in send_packet(), vfd_write(), lcd_write() and
display_open() if the device is no longer present.

Set and read ictx->disconnected under ictx->lock to ensure memory
synchronization. Acquire the lock in imon_disconnect() before setting
the flag to synchronize with any ongoing operations.

Ensure writers exit early and safely after disconnect before the USB
core proceeds with cleanup.

Found by Linux Verification Center (linuxtesting.org) with Syzkaller.

	Reported-by: syzbot+f1a69784f6efe748c3bf@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=f1a69784f6efe748c3bf
Fixes: 21677cf ("V4L/DVB: ir-core: add imon driver")
	Cc: stable@vger.kernel.org

	Signed-off-by: Larshin Sergey <Sergey.Larshin@kaspersky.com>
	Signed-off-by: Sean Young <sean@mess.org>
	Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
(cherry picked from commit fa0f61c)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-3974
cve CVE-2023-30456
commit-author Paolo Bonzini <pbonzini@redhat.com>
commit 112e660

The effective values of the guest CR0 and CR4 registers may differ from
those included in the VMCS12.  In particular, disabling EPT forces
CR4.PAE=1 and disabling unrestricted guest mode forces CR0.PG=CR0.PE=1.

Therefore, checks on these bits cannot be delegated to the processor
and must be performed by KVM.

	Reported-by: Reima ISHII <ishiir@g.ecc.u-tokyo.ac.jp>
	Cc: stable@vger.kernel.org
	Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 112e660)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-3954
cve CVE-2022-45869
commit-author Kazuki Takiguchi <takiguchi.kazuki171@gmail.com>
commit 47b0c2e
upstream-diff Used linux-5.15.y backport
  f88a697 for the clean pick. The
  modified function `direct_page_fault' is the same in both versions

make_mmu_pages_available() must be called with mmu_lock held for write.
However, if the TDP MMU is used, it will be called with mmu_lock held for
read.
This function does nothing unless shadow pages are used, so there is no
race unless nested TDP is used.
Since nested TDP uses shadow pages, old shadow pages may be zapped by this
function even when the TDP MMU is enabled.
Since shadow pages are never allocated by kvm_tdp_mmu_map(), a race
condition can be avoided by not calling make_mmu_pages_available() if the
TDP MMU is currently in use.

I encountered this when repeatedly starting and stopping nested VM.
It can be artificially caused by allocating a large number of nested TDP
SPTEs.

For example, the following BUG and general protection fault are caused in
the host kernel.

pte_list_remove: 00000000cd54fc10 many->many
------------[ cut here ]------------
kernel BUG at arch/x86/kvm/mmu/mmu.c:963!
invalid opcode: 0000 [ctrliq#1] PREEMPT SMP NOPTI
RIP: 0010:pte_list_remove.cold+0x16/0x48 [kvm]
Call Trace:
 <TASK>
 drop_spte+0xe0/0x180 [kvm]
 mmu_page_zap_pte+0x4f/0x140 [kvm]
 __kvm_mmu_prepare_zap_page+0x62/0x3e0 [kvm]
 kvm_mmu_zap_oldest_mmu_pages+0x7d/0xf0 [kvm]
 direct_page_fault+0x3cb/0x9b0 [kvm]
 kvm_tdp_page_fault+0x2c/0xa0 [kvm]
 kvm_mmu_page_fault+0x207/0x930 [kvm]
 npf_interception+0x47/0xb0 [kvm_amd]
 svm_invoke_exit_handler+0x13c/0x1a0 [kvm_amd]
 svm_handle_exit+0xfc/0x2c0 [kvm_amd]
 kvm_arch_vcpu_ioctl_run+0xa79/0x1780 [kvm]
 kvm_vcpu_ioctl+0x29b/0x6f0 [kvm]
 __x64_sys_ioctl+0x95/0xd0
 do_syscall_64+0x5c/0x90

general protection fault, probably for non-canonical address
0xdead000000000122: 0000 [ctrliq#1] PREEMPT SMP NOPTI
RIP: 0010:kvm_mmu_commit_zap_page.part.0+0x4b/0xe0 [kvm]
Call Trace:
 <TASK>
 kvm_mmu_zap_oldest_mmu_pages+0xae/0xf0 [kvm]
 direct_page_fault+0x3cb/0x9b0 [kvm]
 kvm_tdp_page_fault+0x2c/0xa0 [kvm]
 kvm_mmu_page_fault+0x207/0x930 [kvm]
 npf_interception+0x47/0xb0 [kvm_amd]

CVE: CVE-2022-45869
Fixes: a2855af ("KVM: x86/mmu: Allow parallel page faults for the TDP MMU")
	Signed-off-by: Kazuki Takiguchi <takiguchi.kazuki171@gmail.com>
	Cc: stable@vger.kernel.org
	Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit f88a697)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-3154
cve CVE-2022-1852
commit-author Sean Christopherson <seanjc@google.com>
commit fee060c

Whenever x86_decode_emulated_instruction() detects a breakpoint, it
returns the value that kvm_vcpu_check_breakpoint() writes into its
pass-by-reference second argument.  Unfortunately this is completely
bogus because the expected outcome of x86_decode_emulated_instruction
is an EMULATION_* value.

Then, if kvm_vcpu_check_breakpoint() does "*r = 0" (corresponding to
a KVM_EXIT_DEBUG userspace exit), it is misunderstood as EMULATION_OK
and x86_emulate_instruction() is called without having decoded the
instruction.  This causes various havoc from running with a stale
emulation context.

The fix is to move the call to kvm_vcpu_check_breakpoint() where it was
before commit 4aa2691 ("KVM: x86: Factor out x86 instruction
emulation with decoding") introduced x86_decode_emulated_instruction().
The other caller of the function does not need breakpoint checks,
because it is invoked as part of a vmexit and the processor has already
checked those before executing the instruction that #GP'd.

This fixes CVE-2022-1852.

	Reported-by: Qiuhao Li <qiuhao@sysec.org>
	Reported-by: Gaoning Pan <pgn@zju.edu.cn>
	Reported-by: Yongkang Jia <kangel@zju.edu.cn>
Fixes: 4aa2691 ("KVM: x86: Factor out x86 instruction emulation with decoding")
	Cc: stable@vger.kernel.org
	Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220311032801.3467418-2-seanjc@google.com>
[Rewrote commit message according to Qiuhao's report, since a patch
 already existed to fix the bug. - Paolo]
	Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit fee060c)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
@pvts-mat pvts-mat force-pushed the CVE-batch-36_ciqlts8_6 branch from a6a9099 to fd30841 Compare June 21, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant