Linux kernel -stable discussions
 help / color / mirror / Atom feed
* + squashfs-read-symlink-error-before-putting-cache-entry.patch added to mm-nonmm-unstable branch
@ 2026-11-15 23:01 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-11-15 23:01 UTC (permalink / raw)
  To: mm-commits, stable, phillip, guozh23, akpm


The patch titled
     Subject: squashfs: read symlink error before putting cache entry
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     squashfs-read-symlink-error-before-putting-cache-entry.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/squashfs-read-symlink-error-before-putting-cache-entry.patch

This patch will later appear in the mm-nonmm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: Guo Zihao <guozh23@xiaopeng.com>
Subject: squashfs: read symlink error before putting cache entry
Date: Thu, 29 Oct 2026 15:25:42 +0800

In the read error path of squashfs_symlink_readpage() the entry is
put back before its error value is read:

squashfs_cache_put(entry);
= entry->error;

Once the reference count drops to zero another thread can take the entry
back from the cache for a different block and overwrite entry->error, so
the value read here may be stale.  Read the error before dropping the
reference.

Link: https://lore.kernel.org/20261029072542.4131873-1-guozh23@xiaopeng.com
Fixes: 675f02e5e656 ("squashfs: convert squashfs_symlink_read_folio to use folio APIs")
Signed-off-by: Guo Zihao <guozh23@xiaopeng.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Phillip Lougher <phillip@squashfs.org.uk>
Cc: <stable@vger.kernel.org>

 fs/squashfs/symlink.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/squashfs/symlink.c~squashfs-read-symlink-error-before-putting-cache-entry
+++ a/fs/squashfs/symlink.c
@@ -74,8 +74,8 @@ static int squashfs_symlink_read_folio(s
 			ERROR("Unable to read symlink [%llx:%x]\n",
 				squashfs_i(inode)->start,
 				squashfs_i(inode)->offset);
-			squashfs_cache_put(entry);
 			error = entry->error;
+			squashfs_cache_put(entry);
 			goto out;
 		}
 
_

Patches currently in -mm which might be from guozh23@xiaopeng.com are

squashfs-read-symlink-error-before-putting-cache-entry.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-15 23:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-15 23:01 + squashfs-read-symlink-error-before-putting-cache-entry.patch added to mm-nonmm-unstable branch Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox