CVE-2022-49655

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49655
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49655.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49655
Downstream
Related
Published
2025-02-26T02:23:55Z
Modified
2025-10-15T15:54:32.859736Z
Summary
fscache: Fix invalidation/lookup race
Details

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

fscache: Fix invalidation/lookup race

If an NFS file is opened for writing and closed, fscacheinvalidate() will be asked to invalidate the file - however, if the cookie is in the LOOKINGUP state (or the CREATING state), then request to invalidate doesn't get recorded for fscachecookiestate_machine() to do something with.

Fix this by making _fscacheinvalidate() set a flag if it sees the cookie is in the LOOKINGUP state to indicate that we need to go to invalidation. Note that this requires a count on the naccesses counter for the state machine, which that will release when it's done.

fscachecookiestate_machine() then shifts to the INVALIDATING state if it sees the flag.

Without this, an nfs file can get corrupted if it gets modified locally and then read locally as the cache contents may not get updated.

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
d24af13e2e2358a602740c7817ea90da43d3e740
Fixed
b1ae9f617f8a5c848d9205b8e228c6f0d1af754b
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
d24af13e2e2358a602740c7817ea90da43d3e740
Fixed
85e4ea1049c70fb99de5c6057e835d151fb647da

Affected versions

v5.*

v5.16
v5.16-rc5
v5.16-rc6
v5.16-rc7
v5.16-rc8
v5.17
v5.17-rc1
v5.17-rc2
v5.17-rc3
v5.17-rc4
v5.17-rc5
v5.17-rc6
v5.17-rc7
v5.17-rc8
v5.18
v5.18-rc1
v5.18-rc2
v5.18-rc3
v5.18-rc4
v5.18-rc5
v5.18-rc6
v5.18-rc7
v5.18.1
v5.18.10
v5.18.2
v5.18.3
v5.18.4
v5.18.5
v5.18.6
v5.18.7
v5.18.8
v5.18.9
v5.19-rc1
v5.19-rc2
v5.19-rc3
v5.19-rc4

Database specific

vanir_signatures

[
    {
        "digest": {
            "function_hash": "248105708008563554227046544152844712973",
            "length": 803.0
        },
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b1ae9f617f8a5c848d9205b8e228c6f0d1af754b",
        "signature_version": "v1",
        "deprecated": false,
        "signature_type": "Function",
        "target": {
            "file": "fs/fscache/cookie.c",
            "function": "fscache_perform_lookup"
        },
        "id": "CVE-2022-49655-146e69f6"
    },
    {
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "208626023118141834424944594853197578870",
                "296765679945606826349370833140133848060",
                "293881829962544641483226899927347868846",
                "96329174005531824861545865294603398179",
                "61681400574495821207664279352828329071",
                "255373908331586010301981387966580064655",
                "273341151666043856941781390532974093332",
                "13925152380148825765364848536028664989",
                "88623110529699400998154597289426324449",
                "236481306767379865598037700386510187518",
                "19783624771799613074105310349194530981"
            ]
        },
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@85e4ea1049c70fb99de5c6057e835d151fb647da",
        "signature_version": "v1",
        "deprecated": false,
        "signature_type": "Line",
        "target": {
            "file": "fs/fscache/cookie.c"
        },
        "id": "CVE-2022-49655-48d4575a"
    },
    {
        "digest": {
            "function_hash": "223929769106021252187397345759765544839",
            "length": 2843.0
        },
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b1ae9f617f8a5c848d9205b8e228c6f0d1af754b",
        "signature_version": "v1",
        "deprecated": false,
        "signature_type": "Function",
        "target": {
            "file": "fs/fscache/cookie.c",
            "function": "fscache_cookie_state_machine"
        },
        "id": "CVE-2022-49655-52bc696e"
    },
    {
        "digest": {
            "function_hash": "223929769106021252187397345759765544839",
            "length": 2843.0
        },
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@85e4ea1049c70fb99de5c6057e835d151fb647da",
        "signature_version": "v1",
        "deprecated": false,
        "signature_type": "Function",
        "target": {
            "file": "fs/fscache/cookie.c",
            "function": "fscache_cookie_state_machine"
        },
        "id": "CVE-2022-49655-5d87c7fd"
    },
    {
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "208626023118141834424944594853197578870",
                "296765679945606826349370833140133848060",
                "293881829962544641483226899927347868846",
                "96329174005531824861545865294603398179",
                "61681400574495821207664279352828329071",
                "255373908331586010301981387966580064655",
                "273341151666043856941781390532974093332",
                "13925152380148825765364848536028664989",
                "88623110529699400998154597289426324449",
                "236481306767379865598037700386510187518",
                "19783624771799613074105310349194530981"
            ]
        },
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b1ae9f617f8a5c848d9205b8e228c6f0d1af754b",
        "signature_version": "v1",
        "deprecated": false,
        "signature_type": "Line",
        "target": {
            "file": "fs/fscache/cookie.c"
        },
        "id": "CVE-2022-49655-6d0bdaa6"
    },
    {
        "digest": {
            "function_hash": "248105708008563554227046544152844712973",
            "length": 803.0
        },
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@85e4ea1049c70fb99de5c6057e835d151fb647da",
        "signature_version": "v1",
        "deprecated": false,
        "signature_type": "Function",
        "target": {
            "file": "fs/fscache/cookie.c",
            "function": "fscache_perform_lookup"
        },
        "id": "CVE-2022-49655-a86ce97b"
    },
    {
        "digest": {
            "function_hash": "275129610157396944592840416370730187819",
            "length": 1274.0
        },
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@85e4ea1049c70fb99de5c6057e835d151fb647da",
        "signature_version": "v1",
        "deprecated": false,
        "signature_type": "Function",
        "target": {
            "file": "fs/fscache/cookie.c",
            "function": "__fscache_invalidate"
        },
        "id": "CVE-2022-49655-b601759b"
    },
    {
        "digest": {
            "function_hash": "275129610157396944592840416370730187819",
            "length": 1274.0
        },
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b1ae9f617f8a5c848d9205b8e228c6f0d1af754b",
        "signature_version": "v1",
        "deprecated": false,
        "signature_type": "Function",
        "target": {
            "file": "fs/fscache/cookie.c",
            "function": "__fscache_invalidate"
        },
        "id": "CVE-2022-49655-f09b9e1d"
    }
]

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.17.0
Fixed
5.18.11