From: Andrew Morton <akpm@linux-foundation.org>
To: syzbot <syzbot+4324f771847cecb27c54@syzkaller.appspotmail.com>
Cc: baolin.wang@linux.alibaba.com, brauner@kernel.org,
fuse-devel@lists.linux.dev, hughd@google.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
mszeredi@redhat.com, syzkaller-bugs@googlegroups.com,
syzkaller@googlegroups.com
Subject: Re: [syzbot] [mm?] [fuse?] WARNING in shmem_initxattrs
Date: Thu, 5 Nov 2026 11:32:44 -0800 [thread overview]
Message-ID: <20261105113244.274cfd420b666687f37643ec@linux-foundation.org> (raw)
In-Reply-To: <6aecb307.a24d9935.80af2.0019.GAE@google.com>
On Thu, 05 Nov 2026 08:47:03 -0800 syzbot <syzbot+4324f771847cecb27c54@syzkaller.appspotmail.com> wrote:
> Hello,
>
> syzbot has tested the proposed patch and the reproducer did not trigger any issue:
>
> Reported-by: syzbot+4324f771847cecb27c54@syzkaller.appspotmail.com
> Tested-by: syzbot+4324f771847cecb27c54@syzkaller.appspotmail.com
>
Great, thanks. My LLM-controlled live-kernel testing setup liked it
too.
Christian, I'll send this over soon:
From: Andrew Morton <akpm@linux-foundation.org>
Subject: shmem: consume the reserved xattr space despite remount
Date: Thu, 05 Nov 2026 08:08:06 -0800
Creating a tmpfs inode can trigger WARN_ON(ispace) in shmem_initxattrs()
when a concurrent remount sets nr_inodes=0. With panic_on_warn enabled,
this warning can panic the machine.
shmem_initxattrs() reserves space for the security xattrs while inode
limits are enabled. It later tests max_inodes again before consuming that
reservation for each installed xattr. If remount disables the limit
between those steps, successfully installed xattrs leave a nonzero
reservation behind.
Use the remaining reservation, rather than the current mount policy, to
decide whether to subtract the installed xattr's space. This also leaves
the failure path with only the unconsumed reservation to refund.
An initially unlimited filesystem cannot acquire an inode limit through
remount: shmem_reconfigure() rejects that transition.
Link: https://lore.kernel.org/20261105082717.c459bb33778fcf27e5675082@linux-foundation.org
Fixes: 076e5cef28e27 ("simple_xattr: change interface to pass struct simple_xattrs")
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: <syzbot+4324f771847cecb27c54@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=4324f771847cecb27c54
Tested-by: syzbot+4324f771847cecb27c54@syzkaller.appspotmail.com
Cc: Hugh Dickins <hughd@google.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Miklos Szeredi <mszeredi@redhat.com>
Cc: Christian Brauner <brauner@kernel.org>
---
Reproduced the warning before the fix and verified its absence
afterward in a Debian 13 guest with SELinux enabled (permissive).
A temporary hook paused file creation after reserving security-xattr
space. Another process completed a real nr_inodes=0 remount before
creation resumed. The unpatched kernel left 94 bytes unconsumed and
triggered WARN_ON(ispace); the patched kernel consumed the reservation
completely. File contents and the security xattr were verified.
Ordinary creation on limited and unlimited tmpfs mounts also passed
on both kernels. No additional KASAN or lockdep reports occurred.
Tested Linux 7.4.0-rc1 with GCC 13.3, KASAN and lockdep, using KVM:
8 GiB RAM, four vCPUs and one virtual NUMA node, backed by a
Threadripper PRO 3995WX. Both kernels had the same diagnostic hook;
the ordering was forced rather than left to random stress.
mm/shmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/shmem.c~shmem-consume-the-reserved-xattr-space-despite-remount
+++ a/mm/shmem.c
@@ -4451,7 +4451,7 @@ static int shmem_initxattrs(struct inode
if (simple_xattr_add(&sbinfo->xa_cache, &info->xattrs, new_xattr))
break;
- if (sbinfo->max_inodes)
+ if (ispace)
ispace -= simple_xattr_space(new_xattr->name, new_xattr->size);
retain_and_null_ptr(new_xattr);
}
_
prev parent reply other threads:[~2026-11-05 19:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 11:10 syzbot
2026-11-05 16:27 ` Andrew Morton
2026-11-05 16:47 ` syzbot
2026-11-05 19:32 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261105113244.274cfd420b666687f37643ec@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=brauner@kernel.org \
--cc=fuse-devel@lists.linux.dev \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mszeredi@redhat.com \
--cc=syzbot+4324f771847cecb27c54@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=syzkaller@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®