CVE-2023-52909

Source
https://nvd.nist.gov/vuln/detail/CVE-2023-52909
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2023-52909.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2023-52909
Downstream
Related
Published
2024-08-21T06:10:50Z
Modified
2025-10-08T18:12:51.300265Z
Summary
nfsd: fix handling of cached open files in nfsd4_open codepath
Details

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

nfsd: fix handling of cached open files in nfsd4_open codepath

Commit fb70bf124b05 ("NFSD: Instantiate a struct file when creating a regular NFSv4 file") added the ability to cache an open fd over a compound. There are a couple of problems with the way this currently works:

It's racy, as a newly-created nfsdfile can end up with its PENDING bit cleared while the nf is hashed, and the nffile pointer is still zeroed out. Other tasks can find it in this state and they expect to see a valid nffile, and can oops if nffile is NULL.

Also, there is no guarantee that we'll end up creating a new nfsdfile if one is already in the hash. If an extant entry is in the hash with a valid nffile, nfs4getvfsfile will clobber its nffile pointer with the value of opfile and the old nffile will leak.

Fix both issues by making a new nfsdfileacquireiopened variant that takes an optional file pointer. If one is present when this is called, we'll take a new reference to it instead of trying to open the file. If the nfsdfile already has a valid nffile, we'll just ignore the optional file and pass the nfsdfile back as-is.

Also rework the tracepoints a bit to allow for an "opened" variant and don't try to avoid counting acquisitions in the case where we already have a cached open file.

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
c20097329d2c196b818c4666c7820c1378d69d61
Fixed
45c08a752982116f3287afcd1bd9c50f4fab0c28
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
106331a12b0fa5afa6995b1f9ebb03ddcaac6915
Fixed
0b778361998d6c6356b8d2fc7ddf025fb3224654
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
fb70bf124b051d4ded4ce57511dfec6d3ebf2b43
Fixed
973acfdfe90c8a4e58ade97ff0653a498531ff2e
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
fb70bf124b051d4ded4ce57511dfec6d3ebf2b43
Fixed
0b3a551fa58b4da941efeb209b3770868e2eddd7

Affected versions

v5.*

v5.18
v5.19
v5.19-rc1
v5.19-rc2
v5.19-rc3
v5.19-rc4
v5.19-rc5
v5.19-rc6
v5.19-rc7
v5.19-rc8

v6.*

v6.0
v6.0-rc1
v6.0-rc2
v6.0-rc3
v6.0-rc4
v6.0-rc5
v6.0-rc6
v6.0-rc7
v6.1
v6.1-rc1
v6.1-rc2
v6.1-rc3
v6.1-rc4
v6.1-rc5
v6.1-rc6
v6.1-rc7
v6.1-rc8
v6.1.1
v6.1.2
v6.1.3
v6.1.4
v6.1.5
v6.1.6

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.19.0
Fixed
6.1.7