---
id: CVE-2025-40077
title: 'f2fs: fix to avoid overflow while left shift operation'
summary: |-
  In the Linux kernel, the following vulnerability has been resolved:

  f2fs: fix to avoid overflow while left shift operation

  Should cast type of folio->index from pgoff_t to loff_t to avoid overflow
  while left shift operation.
severity: none
vendor: Linux
product: Linux
affected:
  - >-
    Linux >= 3265d3db1f16395cfc6b8ea9b31b4001d98d05ef <
    7fb12f75da1da83b29964c02646f851d919301ea
  - >-
    Linux >= 3265d3db1f16395cfc6b8ea9b31b4001d98d05ef <
    ef49378864bb1ed14cd48c8e687729e12714d849
  - >-
    Linux >= 3265d3db1f16395cfc6b8ea9b31b4001d98d05ef <
    0e75a098b0a37f02ca31fe99ac16004c8163cf67
  - >-
    Linux >= 3265d3db1f16395cfc6b8ea9b31b4001d98d05ef <
    57d3381dfb97ff73ddd18601017fec21cca80985
  - >-
    Linux >= 3265d3db1f16395cfc6b8ea9b31b4001d98d05ef <
    0fe1c6bec54ea68ed8c987b3890f2296364e77bb
  - Linux 5.8
published: '2025-10-28'
updated: '2026-10-30'
sourceUpdated: '2026-10-30T12:22:49.284Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2025-40077'
references:
  - url: 'https://git.kernel.org/stable/c/7fb12f75da1da83b29964c02646f851d919301ea'
  - url: 'https://git.kernel.org/stable/c/ef49378864bb1ed14cd48c8e687729e12714d849'
  - url: 'https://git.kernel.org/stable/c/0e75a098b0a37f02ca31fe99ac16004c8163cf67'
  - url: 'https://git.kernel.org/stable/c/57d3381dfb97ff73ddd18601017fec21cca80985'
  - url: 'https://git.kernel.org/stable/c/0fe1c6bec54ea68ed8c987b3890f2296364e77bb'
tags:
  - cve.org
epss: 0.00199
epssPercentile: 0.09781
ingestedAt: '2026-11-03T23:58:20.712Z'
---

## Overview

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

f2fs: fix to avoid overflow while left shift operation

Should cast type of folio->index from pgoff_t to loff_t to avoid overflow
while left shift operation.

## Affected

- `Linux >= 3265d3db1f16395cfc6b8ea9b31b4001d98d05ef < 7fb12f75da1da83b29964c02646f851d919301ea`
- `Linux >= 3265d3db1f16395cfc6b8ea9b31b4001d98d05ef < ef49378864bb1ed14cd48c8e687729e12714d849`
- `Linux >= 3265d3db1f16395cfc6b8ea9b31b4001d98d05ef < 0e75a098b0a37f02ca31fe99ac16004c8163cf67`
- `Linux >= 3265d3db1f16395cfc6b8ea9b31b4001d98d05ef < 57d3381dfb97ff73ddd18601017fec21cca80985`
- `Linux >= 3265d3db1f16395cfc6b8ea9b31b4001d98d05ef < 0fe1c6bec54ea68ed8c987b3890f2296364e77bb`
- `Linux 5.8`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
