LinuxのLinux Kernelにおける解放済みメモリの使用に関する脆弱性
タイトル LinuxのLinux Kernelにおける解放済みメモリの使用に関する脆弱性
概要

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スループットに影響を与えません。

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

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

公表日 2026年5月1日0:00
登録日 2026年5月13日10:25
最終更新日 2026年5月13日10:25
CVSS3.0 : 重要
スコア 7.8
ベクター CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
影響を受けるシステム
Linux
Linux Kernel 6.13 以上 6.18.22 未満
Linux Kernel 6.19 以上 6.19.12 未満
Linux Kernel 7.0
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
その他
変更履歴
No 変更内容 変更日
1 [2026年05月13日]
  掲載
2026年5月13日10:25

NVD脆弱性情報
CVE-2026-31769
概要

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.

公表日 2026年5月2日0:16
登録日 2026年5月2日4:07
最終更新日 2026年5月3日16:16
関連情報、対策とツール
共通脆弱性一覧