LinuxのLinux Kernelにおける整数オーバーフローの脆弱性
タイトル LinuxのLinux Kernelにおける整数オーバーフローの脆弱性
概要

Linuxカーネルにおいて、以下の脆弱性が修正されました。usb: gadget: f_mass_storageにおけるcheck_command_size_in_blocks()関数での潜在的な整数オーバーフローの問題です。`check_command_size_in_blocks()`関数は、`common-data_size_from_cmnd`をブロックサイズ(`common-curlun-blkbits`)分だけ左シフトしてデータサイズ(バイト単位)を計算します。しかし、このシフト操作によって整数オーバーフローが発生するかどうかの検証が行われていませんでした。ブロックサイズは`fsg_lun_open()`で設定され、`common-data_size_from_cmnd`は`do_scsi_command()`で設定されます。初期化時にはこれら二つの変数間での整数オーバーフローの確認が行われていませんでした。そのため、悪意のあるUSBホストが大量のデータを要求するSCSI READまたはWRITEコマンド(`common-data_size_from_cmnd`)を送信すると、左シフト操作がオーバーフローしデータサイズが切り詰められて境界チェックを回避できる可能性がありました。これにより、メモリ破損や範囲外アクセスが発生する恐れがありました。この問題は、check_shl_overflow()マクロを用いて安全にシフトを行い、オーバーフローを検出することで修正されました。

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

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

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

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

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

usb: gadget: f_mass_storage: Fix potential integer overflow in check_command_size_in_blocks()

The `check_command_size_in_blocks()` function calculates the data size
in bytes by left shifting `common->data_size_from_cmnd` by the block
size (`common->curlun->blkbits`). However, it does not validate whether
this shift operation will cause an integer overflow.

Initially, the block size is set up in `fsg_lun_open()` , and the
`common->data_size_from_cmnd` is set up in `do_scsi_command()`. During
initialization, there is no integer overflow check for the interaction
between two variables.

So if a malicious USB host sends a SCSI READ or WRITE command
requesting a large amount of data (`common->data_size_from_cmnd`), the
left shift operation can wrap around. This results in a truncated data
size, which can bypass boundary checks and potentially lead to memory
corruption or out-of-bounds accesses.

Fix this by using the check_shl_overflow() macro to safely perform the
shift and catch any overflows.

公表日 2026年4月10日20:16
登録日 2026年4月15日11:36
最終更新日 2026年4月14日0:02
関連情報、対策とツール
共通脆弱性一覧