Commit d3b71f2
CKI KWF Bot
Merge: CVE-2025-39697: NFS: Fix a race when updating an existing write
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1422
JIRA: https://issues.redhat.com/browse/RHEL-113858
CVE: CVE-2025-39697
```
commit 76d2e38
Author: Trond Myklebust <trond.myklebust@hammerspace.com>
Date: Sat Aug 16 07:25:20 2025 -0700
NFS: Fix a race when updating an existing write
After nfs_lock_and_join_requests() tests for whether the request is
still attached to the mapping, nothing prevents a call to
nfs_inode_remove_request() from succeeding until we actually lock the
page group.
The reason is that whoever called nfs_inode_remove_request() doesn't
necessarily have a lock on the page group head.
So in order to avoid races, let's take the page group lock earlier in
nfs_lock_and_join_requests(), and hold it across the removal of the
request in nfs_inode_remove_request().
Reported-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Joe Quanaim <jdq@meta.com>
Tested-by: Andrew Steffen <aksteffen@meta.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Fixes: bd37d6f ("NFSv4: Convert nfs_lock_and_join_requests() to use nfs_page_find_head_request()")
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
```
Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
---
<small>Created 2025-09-09 22:21 UTC by backporter - [KWF FAQ](https://red.ht/kernel_workflow_doc) - [Slack #team-kernel-workflow](https://redhat-internal.slack.com/archives/C04LRUPMJQ5) - [Source](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/webhook/utils/backporter.py) - [Documentation](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/docs/README.backporter.md) - [Report an issue](https://issues.redhat.com/secure/CreateIssueDetails!init.jspa?pid=12334433&issuetype=1&priority=4&summary=backporter+webhook+issue&components=kernel-workflow+/+backporter)</small>
Approved-by: Jay Shin <jaeshin@redhat.com>
Approved-by: Benjamin Coddington <bcodding@redhat.com>
Approved-by: Scott Mayhew <smayhew@redhat.com>
Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>
Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>3 files changed
+16
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
257 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
261 | | - | |
262 | | - | |
| 263 | + | |
263 | 264 | | |
264 | 265 | | |
265 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
157 | | - | |
| 156 | + | |
158 | 157 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | 158 | | |
167 | 159 | | |
168 | | - | |
169 | | - | |
170 | 160 | | |
171 | 161 | | |
172 | 162 | | |
| |||
585 | 575 | | |
586 | 576 | | |
587 | 577 | | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
588 | 582 | | |
589 | 583 | | |
| 584 | + | |
590 | 585 | | |
591 | 586 | | |
592 | 587 | | |
593 | 588 | | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
| 589 | + | |
601 | 590 | | |
602 | 591 | | |
603 | 592 | | |
| |||
786 | 775 | | |
787 | 776 | | |
788 | 777 | | |
789 | | - | |
| 778 | + | |
| 779 | + | |
790 | 780 | | |
791 | 781 | | |
792 | 782 | | |
| |||
798 | 788 | | |
799 | 789 | | |
800 | 790 | | |
| 791 | + | |
801 | 792 | | |
802 | 793 | | |
803 | 794 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| |||
0 commit comments