製品・ソフトウェアに関する情報
LinuxのLinux Kernelにおける整数オーバーフローの脆弱性
Title LinuxのLinux Kernelにおける整数オーバーフローの脆弱性
Summary

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()マクロを用いて安全にシフトを行い、オーバーフローを検出することで修正されました。

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

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

Publication Date April 10, 2026, midnight
Registration Date May 22, 2026, 10:56 a.m.
Last Update May 22, 2026, 10:56 a.m.
CVSS3.0 : 警告
Score 5.5
Vector CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Affected System
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 (共通脆弱性タイプ一覧)
その他
Change Log
No Changed Details Date of change
1 [2026年05月22日]
  掲載
May 22, 2026, 10:56 a.m.

NVD Vulnerability Information
CVE-2026-31412
Summary

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.

Publication Date April 10, 2026, 8:16 p.m.
Registration Date April 15, 2026, 11:36 a.m.
Last Update April 14, 2026, 12:02 a.m.
Related information, measures and tools
Common Vulnerabilities List