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

Linuxカーネルにおいて、以下の脆弱性が修正されました。eventpollのep_removeにおけるstruct eventpollおよびstruct fileのUse-After-Free(UAF)問題に対する修正です。ep_remove()(ep_remove_file()経由)ではfile-f_lockの下でfile-f_epをクリアしましたが、その後もクリティカルセクション内で@fileを使用し続けていました(is_file_epoll()やhlist_del_rcu()をhead経由で呼び出し、spin_unlockを行っていました)。同時に動作していた__fput()はeventpoll_release()の高速パスを経由し、その過程で一時的にNULLとなったfile-f_epを観察し、eventpoll_release_file()をスキップしてf_op-releaseおよびfile_free()を実行していました。epoll-watches-epollのケースでは、f_op-releaseはep_eventpoll_release() - ep_clear_and_put() - ep_free()となり、これが監視中のstruct eventpollをkfree()します。この中の埋め込みメンバのrefsにあるhlist_headはepi-fllink.pprevが指している場所と同一であり、その後のhlist_del_rcu()の「*pprev = next」により、解放済みのkmalloc-192メモリが上書きされる問題がありました。さらにstruct fileはSLAB_TYPESAFE_BY_RCUであるため、ep_remove()がまだそのロック内にいる間に、@fileを裏付けるスロットがalloc_empty_file()により再利用され、f_lockとf_epが再初期化される可能性があります。つまり、攻撃者が制御可能なkmem_cache_free()が誤ったスラブキャッシュに対して実行される事態が発生する恐れがありました。修正では、ep_remove()の先頭でepi_fget()により@fileをピン留めし、ピン留めが成功した場合にのみクリティカルセクションに入るようにしました。ピン留めした状態の@fileは参照カウントがゼロにならず、__fput()の実行を抑制します。これにより、監視されているstruct eventpollがhlist_del_rcu()およびf_lockの使用を跨いで有効な状態に保たれ、両方のUse-After-Freeを防止します。もしピン留めが失敗した場合は、@fileはすでに参照カウントゼロに達しており、__fput()が進行中です。f_epをクリアする前に早期リターンしているため、その経路はeventpoll_release()のスローパスであるeventpoll_release_file()を通り、ep-mtx上で待機し、待機側のep_clear_and_put()がロックを解放するのを待ちます。早期リターンしたepiのep-refcountのシェアは維持されているため、ep_clear_and_put()の最後のep_refcount_dec_and_test()はeventpoll_release_file()の動作中にeventpollを強制解放しません。孤立したepiはそこで適切にクリーンアップされます。ピン留め成功はまた、このepiに対してeventpoll_release_file()と競合していないことも証明するため、f_lock下のepi-dyingを再チェックしていた冗長な処理を削除しました。安価なロックなしのREAD_ONCE(epi-dying)による高速パスでの早期リターンはそのまま残します。

Possible impacts ・当該ソフトウェアが扱う全ての情報が外部に漏れる可能性があります。 ・当該ソフトウェアが扱う全ての情報が書き換えられる可能性があります。 ・当該ソフトウェアが完全に停止する可能性があります。 
Solution

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

Publication Date May 30, 2026, midnight
Registration Date June 11, 2026, 4:19 p.m.
Last Update June 11, 2026, 4:19 p.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 5.15.209 以上 5.16 未満
Linux Kernel 6.1.175 以上 6.2 未満
Linux Kernel 6.19 以上 7.0.10 未満
Linux Kernel 6.4 以上 6.18.33 未満
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
その他
Change Log
No Changed Details Date of change
1 [2026年06月11日]
  掲載
June 11, 2026, 4:19 p.m.

NVD Vulnerability Information
CVE-2026-46242
Summary

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

eventpoll: fix ep_remove struct eventpoll / struct file UAF

ep_remove() (via ep_remove_file()) cleared file->f_ep under
file->f_lock but then kept using @file inside the critical section
(is_file_epoll(), hlist_del_rcu() through the head, spin_unlock).
A concurrent __fput() taking the eventpoll_release() fastpath in
that window observed the transient NULL, skipped
eventpoll_release_file() and ran to f_op->release / file_free().

For the epoll-watches-epoll case, f_op->release is
ep_eventpoll_release() -> ep_clear_and_put() -> ep_free(), which
kfree()s the watched struct eventpoll. Its embedded ->refs
hlist_head is exactly where epi->fllink.pprev points, so the
subsequent hlist_del_rcu()'s "*pprev = next" scribbles into freed
kmalloc-192 memory.

In addition, struct file is SLAB_TYPESAFE_BY_RCU, so the slot
backing @file could be recycled by alloc_empty_file() --
reinitializing f_lock and f_ep -- while ep_remove() is still
nominally inside that lock. The upshot is an attacker-controllable
kmem_cache_free() against the wrong slab cache.

Pin @file via epi_fget() at the top of ep_remove() and gate the
critical section on the pin succeeding. With the pin held @file
cannot reach refcount zero, which holds __fput() off and
transitively keeps the watched struct eventpoll alive across the
hlist_del_rcu() and the f_lock use, closing both UAFs.

If the pin fails @file has already reached refcount zero and its
__fput() is in flight. Because we bailed before clearing f_ep,
that path takes the eventpoll_release() slow path into
eventpoll_release_file() and blocks on ep->mtx until the waiter
side's ep_clear_and_put() drops it. The bailed epi's share of
ep->refcount stays intact, so the trailing ep_refcount_dec_and_test()
in ep_clear_and_put() cannot free the eventpoll out from under
eventpoll_release_file(); the orphaned epi is then cleaned up
there.

A successful pin also proves we are not racing
eventpoll_release_file() on this epi, so drop the now-redundant
re-check of epi->dying under f_lock. The cheap lockless
READ_ONCE(epi->dying) fast-path bailout stays.

Publication Date May 30, 2026, 10:16 p.m.
Registration Date May 31, 2026, 4:15 a.m.
Last Update June 5, 2026, 4:16 p.m.
Related information, measures and tools
Common Vulnerabilities List