製品・ソフトウェアに関する情報
LinuxのLinux Kernelにおける解放済みメモリの使用に関する脆弱性
Title LinuxのLinux Kernelにおける解放済みメモリの使用に関する脆弱性
Summary

Linuxカーネルにおいて、以下の脆弱性が修正されました。cxl/portのcxl_detach_ep()におけるparent_portの使用後解放の問題を修正しました。cxl_detach_ep()は、スイッチポート配下のすべてのCXLメモリデバイスが削除された際にボトムアップ削除処理として呼び出されます。階層内の各ポートに対して、そのポートと親ポートの両方をロックし、エンドポイントを削除します。ポートが空になった場合は死んだ状態とマークし、delete_switch_port()を呼び出してポートの登録解除を行います。この処理中にparent_portが解放後に使用される可能性がある箇所が2つ存在します。1つ目は、同時にデタッチが進行している場合です。bus_find_device()で2番目の作業者がポートを見つけた時点で既にそのポートが処理済みの場合、parent_portをピン留めしていなければport-deadの検出および親ポートのロック解除を試みる際にすでに解放されている可能性があります。プロダクション環境のカーネルではこれは無音のメモリ破損となり、ロックデバッグ有効時には以下のように現れます。[]DEBUG_LOCKS_WARN_ON(__owner_task(owner) != get_current()) []WARNING: kernel/locking/mutex.c:949 at __mutex_unlock_slowpath+0x1ee/0x310 []Call Trace: []mutex_unlock+0xd/0x20 []cxl_detach_ep+0x180/0x400 [cxl_core] []devm_action_release+0x10/0x20 []devres_release_all+0xa8/0xe0 []device_unbind_cleanup+0xd/0xa0 []really_probe+0x1a6/0x3e0です。2つ目はdelete_switch_port()がparent_portに登録された3つのdevmアクションを解放するときです。その最後のアクションであるunregister_port()が子ポートに対してdevice_unregister()を呼び出し、それが連鎖的に発生する可能性があります。もしparent_portもこの時点で空であれば、デバイスコアがそれも登録解除・解放してしまいます。したがってdelete_switch_port()の戻り時点でparent_portが解放されており、その後のdevice_unlock(&parent_port-dev)が解放済みメモリに対して操作を行います。カーネルログは上述と同様ですが、cxl_detach_ep()内のオフセットが異なります。これら2つの問題は、子ポートと親ポート間のライフタイム保証が欠如していることに起因します。ポートのライフタイムルールを確立し、子ポートは解放されるまで親デバイスの参照を保持するようにしました。ポート割り当て時に参照を取り、解放時に参照を解放します。これにより親は子のライフタイム全体で有効であることが保証され、cxl_detach_ep()での使用後解放の問題を排除できます。この問題はCXLデバイスが存在するQEMU上でcxl_acpiのリロードを行うことで容易に再現できます。

Possible impacts 当該ソフトウェアが扱う全ての情報が外部に漏れる可能性があります。 また、当該ソフトウェアが扱う全ての情報が書き換えられる可能性があります。 さらに、当該ソフトウェアが完全に停止する可能性があります。 そして、この脆弱性を悪用した攻撃の影響は、他のソフトウェアには及びません。 
Solution

リリース情報、またはパッチ情報が公開されています。参考情報を参照して適切な対策を実施してください。

Publication Date April 22, 2026, midnight
Registration Date April 30, 2026, 11:06 a.m.
Last Update April 30, 2026, 11:06 a.m.
CVSS3.0 : 重要
Score 7.8
Vector CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Affected System
Linux
Linux Kernel 6.13 以上 6.18.21 未満
Linux Kernel 6.19 以上 6.19.11 未満
Linux Kernel 6.3 以上 6.12.80 未満
Linux Kernel 7.0
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
その他
Change Log
No Changed Details Date of change
1 [2026年04月30日]
  掲載
April 30, 2026, 11:06 a.m.

NVD Vulnerability Information
CVE-2026-31530
Summary

In the Linux kernel, the following vulnerability has been resolved:

cxl/port: Fix use after free of parent_port in cxl_detach_ep()

cxl_detach_ep() is called during bottom-up removal when all CXL memory
devices beneath a switch port have been removed. For each port in the
hierarchy it locks both the port and its parent, removes the endpoint,
and if the port is now empty, marks it dead and unregisters the port
by calling delete_switch_port(). There are two places during this work
where the parent_port may be used after freeing:

First, a concurrent detach may have already processed a port by the
time a second worker finds it via bus_find_device(). Without pinning
parent_port, it may already be freed when we discover port->dead and
attempt to unlock the parent_port. In a production kernel that's a
silent memory corruption, with lock debug, it looks like this:

[]DEBUG_LOCKS_WARN_ON(__owner_task(owner) != get_current())
[]WARNING: kernel/locking/mutex.c:949 at __mutex_unlock_slowpath+0x1ee/0x310
[]Call Trace:
[]mutex_unlock+0xd/0x20
[]cxl_detach_ep+0x180/0x400 [cxl_core]
[]devm_action_release+0x10/0x20
[]devres_release_all+0xa8/0xe0
[]device_unbind_cleanup+0xd/0xa0
[]really_probe+0x1a6/0x3e0

Second, delete_switch_port() releases three devm actions registered
against parent_port. The last of those is unregister_port() and it
calls device_unregister() on the child port, which can cascade. If
parent_port is now also empty the device core may unregister and free
it too. So by the time delete_switch_port() returns, parent_port may
be free, and the subsequent device_unlock(&parent_port->dev) operates
on freed memory. The kernel log looks same as above, with a different
offset in cxl_detach_ep().

Both of these issues stem from the absence of a lifetime guarantee
between a child port and its parent port.

Establish a lifetime rule for ports: child ports hold a reference to
their parent device until release. Take the reference when the port
is allocated and drop it when released. This ensures the parent is
valid for the full lifetime of the child and eliminates the use after
free window in cxl_detach_ep().

This is easily reproduced with a reload of cxl_acpi in QEMU with CXL
devices present.

Publication Date April 22, 2026, 11:16 p.m.
Registration Date April 25, 2026, 4:05 a.m.
Last Update April 29, 2026, 2:53 a.m.
Affected software configurations
Configuration1 or higher or less more than less than
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.3 6.12.80
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.13 6.18.21
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.19 6.19.11
cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc5:*:*:*:*:*:*
Related information, measures and tools
Common Vulnerabilities List