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

Linuxカーネルにおいて、以下の脆弱性が修正されました。gpibのIO ioctlハンドラに存在したuse-after-freeの問題です。IBRD、IBWRT、IBCMD、およびIBWAIT ioctlハンドラは、board-big_gpib_mutexが解放された後にgpib_descriptorポインタを使用していました。この間に、IBCLOSEDEV ioctlがclose_dev_ioctl()を通じてディスクリプタを解放する可能性があり、use-after-freeが発生していました。IOハンドラ(read_ioctl、write_ioctl、command_ioctl)は、ハンドラを呼び出す前に明示的にbig_gpib_mutexを解放します。wait_ioctl()はbig_gpib_mutexを保持したまま呼び出されますが、ibwait()はwait_maskが0以外の場合に内部でmutexを解放します。これら四つのケースすべてで、handle_to_descriptor()から得たディスクリプタポインタは保護されていませんでした。これを修正するために、struct gpib_descriptorにカーネル専用のdescriptor_busy参照カウントを導入しました。各ハンドラはfile_priv-descriptors_mutexの下でatomicにdescriptor_busyをインクリメントし、ロックを解放した後に処理を行い、処理完了後にそれをデクリメントします。close_dev_ioctl()は同じロック下でdescriptor_busyをチェックし、参照カウントが0でない場合は-EBUSYでクローズを拒否します。複数のハンドラが同じディスクリプタに同時に操作する可能性があるため(例:異なるスレッドからの同一ハンドルに対するIBRDとIBWAIT)、単純なフラグではなく参照カウントが必要です。io_in_progressはIBWAIT ioctl(set_maskにCMPLを含むgeneral_ibstatus()経由)で特権のないユーザースペースからクリア可能であるため、これに基づくチェックだけでは回避される可能性があります。新しいdescriptor_busyカウンタはカーネルIOパスのみで操作されます。ロックの順序は一貫しており(big_gpib_mutex - descriptors_mutex)、ハンドラは検索時のみ短時間descriptors_mutexを保持するため、デッドロックのリスクはなく、IOスループットに影響を与えません。

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

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

Publication Date May 1, 2026, midnight
Registration Date May 13, 2026, 10:25 a.m.
Last Update May 13, 2026, 10:25 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.22 未満
Linux Kernel 6.19 以上 6.19.12 未満
Linux Kernel 7.0
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
その他
Change Log
No Changed Details Date of change
1 [2026年05月13日]
  掲載
May 13, 2026, 10:25 a.m.

NVD Vulnerability Information
CVE-2026-31769
Summary

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

gpib: fix use-after-free in IO ioctl handlers

The IBRD, IBWRT, IBCMD, and IBWAIT ioctl handlers use a gpib_descriptor
pointer after board->big_gpib_mutex has been released. A concurrent
IBCLOSEDEV ioctl can free the descriptor via close_dev_ioctl() during
this window, causing a use-after-free.

The IO handlers (read_ioctl, write_ioctl, command_ioctl) explicitly
release big_gpib_mutex before calling their handler. wait_ioctl() is
called with big_gpib_mutex held, but ibwait() releases it internally
when wait_mask is non-zero. In all four cases, the descriptor pointer
obtained from handle_to_descriptor() becomes unprotected.

Fix this by introducing a kernel-only descriptor_busy reference count
in struct gpib_descriptor. Each handler atomically increments
descriptor_busy under file_priv->descriptors_mutex before releasing the
lock, and decrements it when done. close_dev_ioctl() checks
descriptor_busy under the same lock and rejects the close with -EBUSY
if the count is non-zero.

A reference count rather than a simple flag is necessary because
multiple handlers can operate on the same descriptor concurrently
(e.g. IBRD and IBWAIT on the same handle from different threads).

A separate counter is needed because io_in_progress can be cleared from
unprivileged userspace via the IBWAIT ioctl (through general_ibstatus()
with set_mask containing CMPL), which would allow an attacker to bypass
a check based solely on io_in_progress. The new descriptor_busy
counter is only modified by the kernel IO paths.

The lock ordering is consistent (big_gpib_mutex -> descriptors_mutex)
and the handlers only hold descriptors_mutex briefly during the lookup,
so there is no deadlock risk and no impact on IO throughput.

Publication Date May 2, 2026, 12:16 a.m.
Registration Date May 2, 2026, 4:07 a.m.
Last Update May 3, 2026, 4:16 p.m.
Related information, measures and tools
Common Vulnerabilities List