On Sun, 2025-12-07 at 09:42 +0900, Greg KH wrote:
On Sat, Dec 06, 2025 at 07:24:14PM -0500, Trond Myklebust wrote:
From: Mike Snitzer snitzer@kernel.org
commit 3af870aedbff10bfed220e280b57a405e972229f upstream.
Commit f2060bdc21d7 ("nfs/localio: add refcounting for each iocb IO associated with NFS pgio header") inadvertantly reintroduced the same potential for __put_cred() triggering BUG_ON(cred == current->cred) that commit 992203a1fba5 ("nfs/localio: restore creds before releasing pageio data") fixed.
Fix this by saving and restoring the cred around each {read,write}_iter call within the respective for loop of nfs_local_call_{read,write}.
Reported-by: Zorro Lang zlang@redhat.com Fixes: f2060bdc21d7 ("nfs/localio: add refcounting for each iocb IO associated with NFS pgio header") Cc: stable@vger.kernel.org # 6.18.x Signed-off-by: Mike Snitzer snitzer@kernel.org Signed-off-by: Trond Myklebust trond.myklebust@hammerspace.com
What kernel is this for, just 6.18.y? And why was the changelog rewritten/formatted from the original?
The patch is just for 6.18.y. It is actually the original patch that was submitted in the last week of the 6.18-rc series. That patch didn't make it in before 6.18 was released due to the Thanksgiving holiday, etc.
When commits 94afb627dfc2 and bff3c841f7bd were merged early in the 6.19 merge window, a port was required in order to match up the fix to the new "scoped_with_creds()" paradigm. While that port could be backported as is, it would require pulling in the full framework for "scoped_with_creds()", hence the preference for just submitting the original patch.