LinuxのLinux Kernelにおける境界外読み取りに関する脆弱性
タイトル LinuxのLinux Kernelにおける境界外読み取りに関する脆弱性
概要

Linuxカーネルにおいて、以下の脆弱性が修正されました。can: gw: cgw_csum_crc8_rel()におけるヒープの範囲外アクセスの修正です。cgw_csum_crc8_rel()はcalc_idx()を通じて境界安全なインデックスを正しく計算しています。int from = calc_idx(crc8-from_idx, cf-len); int to = calc_idx(crc8-to_idx, cf-len); int res = calc_idx(crc8-result_idx, cf-len); if (from 0 || to 0 || res 0) return; しかしながら、その後のループと結果の書き込みにおいては、計算済みの変数ではなく、生のs8フィールドが直接使用されています。for (i = crc8-from_idx; ...) /* バグ: 生の負のインデックス */ cf-data[crc8-result_idx] = ...; /* バグ: 生の負のインデックス */ from_idx = to_idx = result_idx = -64で64バイトのCAN FDフレームの場合、calc_idx(-64, 64) = 0となり、ガードは通過しますが、ループはi = -64で繰り返され、cf-data[-64]を読み込み、書き込みもcf-data[-64]に対して行われます。この書き込みはヒープ上のcanfd_frameの開始位置より56バイト(7.0-rc)または40バイト(6.19以下)前の領域に及ぶ可能性があります。対応関数cgw_csum_xor_rel()は`from`/`to`/`res`を適切に使用しているため、cgw_csum_crc8_rel()もこれに合わせて修正されました。linux-7.0-rc2のKASANにより以下のように確認されています。BUG: KASAN: slab-out-of-bounds in cgw_csum_crc8_rel+0x515/0x5b0 Read of size 1 at addr ffff8880076619c8 by task poc_cgw_oob/62 can-gwのcrc8チェックサムを設定するにはCAP_NET_ADMIN権限が必要です。

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

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

公表日 2026年4月24日0:00
登録日 2026年4月30日12:09
最終更新日 2026年4月30日12:09
CVSS3.0 : 重要
スコア 8.8
ベクター CVSS:3.0/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
影響を受けるシステム
Linux
Linux Kernel 5.11 以上 5.15.203 未満
Linux Kernel 5.16 以上 6.1.168 未満
Linux Kernel 5.4
Linux Kernel 5.4.1 以上 5.10.253 未満
Linux Kernel 6.13 以上 6.18.21 未満
Linux Kernel 6.19 以上 6.19.11 未満
Linux Kernel 6.2 以上 6.6.131 未満
Linux Kernel 6.7 以上 6.12.80 未満
Linux Kernel 7.0
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
その他
変更履歴
No 変更内容 変更日
1 [2026年04月30日]
  掲載
2026年4月30日12:09

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

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

can: gw: fix OOB heap access in cgw_csum_crc8_rel()

cgw_csum_crc8_rel() correctly computes bounds-safe indices via calc_idx():

int from = calc_idx(crc8->from_idx, cf->len);
int to = calc_idx(crc8->to_idx, cf->len);
int res = calc_idx(crc8->result_idx, cf->len);

if (from < 0 || to < 0 || res < 0)
return;

However, the loop and the result write then use the raw s8 fields directly
instead of the computed variables:

for (i = crc8->from_idx; ...) /* BUG: raw negative index */
cf->data[crc8->result_idx] = ...; /* BUG: raw negative index */

With from_idx = to_idx = result_idx = -64 on a 64-byte CAN FD frame,
calc_idx(-64, 64) = 0 so the guard passes, but the loop iterates with
i = -64, reading cf->data[-64], and the write goes to cf->data[-64].
This write might end up to 56 (7.0-rc) or 40 (<= 6.19) bytes before the
start of the canfd_frame on the heap.

The companion function cgw_csum_xor_rel() uses `from`/`to`/`res`
correctly throughout; fix cgw_csum_crc8_rel() to match.

Confirmed with KASAN on linux-7.0-rc2:
BUG: KASAN: slab-out-of-bounds in cgw_csum_crc8_rel+0x515/0x5b0
Read of size 1 at addr ffff8880076619c8 by task poc_cgw_oob/62

To configure the can-gw crc8 checksums CAP_NET_ADMIN is needed.

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