LinuxのLinux Kernelにおける競合状態に関する脆弱性
タイトル LinuxのLinux Kernelにおける競合状態に関する脆弱性
概要

Linuxカーネルにおいて、mm/damon/coreのdamos_walk()とkdamond_fn()の終了競合の修正が行われました。kdamond_fn()のメインループ終了時に未処理のdamos_walk()リクエストをキャンセルし、damon_ctx-kdamondを解除します。一方、damos_walk()はリクエストをキューに登録した後、damon_ctx-kdamondがまだ存在するか確認し、存在すれば処理を待機します。しかし、これらの操作は別々のロックで保護されているため競合が発生し、デッドロックの可能性がありました。具体的には、kdamondが終了処理中に新たなdamos_walk()リクエストが登録されると、そのリクエストが処理されずに待機状態となり無限待機を引き起こしました。この問題を解決するために、新たにdamon_ctx構造体にwalk_control_obsoleteフィールドを導入し、同じロックで保護しつつdamos_walk()のリクエスト登録を制御します。kdamond_fn()はリクエストキャンセル前にこのフラグを設定し、damos_walk()はこのフラグをチェックして新規リクエストの追加を防止します。これにより、競合状況が解消されて適切な終了処理が保証されるようになりました。この問題はsashikoによって発見されました。

想定される影響 ・当該ソフトウェアが扱う情報について、外部への漏えいは発生しません。 ・当該ソフトウェアが扱う情報について、書き換えは発生しません。 ・当該ソフトウェアが完全に停止する可能性があります。 
対策

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

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

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

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

mm/damon/core: fix damos_walk() vs kdamond_fn() exit race

When kdamond_fn() main loop is finished, the function cancels remaining
damos_walk() request and unset the damon_ctx->kdamond so that API callers
and API functions themselves can show the context is terminated.
damos_walk() adds the caller's request to the queue first. After that, it
shows if the kdamond of the damon_ctx is still running (damon_ctx->kdamond
is set). Only if the kdamond is running, damos_walk() starts waiting for
the kdamond's handling of the newly added request.

The damos_walk() requests registration and damon_ctx->kdamond unset are
protected by different mutexes, though. Hence, damos_walk() could race
with damon_ctx->kdamond unset, and result in deadlocks.

For example, let's suppose kdamond successfully finished the damow_walk()
request cancelling. Right after that, damos_walk() is called for the
context. It registers the new request, and shows the context is still
running, because damon_ctx->kdamond unset is not yet done. Hence the
damos_walk() caller starts waiting for the handling of the request.
However, the kdamond is already on the termination steps, so it never
handles the new request. As a result, the damos_walk() caller thread
infinitely waits.

Fix this by introducing another damon_ctx field, namely
walk_control_obsolete. It is protected by the
damon_ctx->walk_control_lock, which protects damos_walk() request
registration. Initialize (unset) it in kdamond_fn() before letting
damon_start() returns and set it just before the cancelling of the
remaining damos_walk() request is executed. damos_walk() reads the
obsolete field under the lock and avoids adding a new request.

After this change, only requests that are guaranteed to be handled or
cancelled are registered. Hence the after-registration DAMON context
termination check is no longer needed. Remove it together.

The issue is found by sashiko [1].

公表日 2026年5月27日23:17
登録日 2026年5月28日4:12
最終更新日 2026年5月27日23:48
関連情報、対策とツール
共通脆弱性一覧