From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,stable@vger.kernel.org,shaggy@kernel.org,
sebasjosue84@gmail.com,keyakoto@gmail.com,jkoolstra@xs4all.nl,
akpm@linux-foundation.org
Subject: [withdrawn] jfs-validate-xattr-entry-bounds-before-replacing-an-attribute.patch removed from -mm tree
Date: Sat, 05 Dec 2026 17:40:33 -0800 [thread overview]
Message-ID: <20261206014033.D19251F0092B@smtp.kernel.org> (raw)
The quilt patch titled
Subject: jfs: validate xattr entry bounds before replacing an attribute
has been removed from the -mm tree. Its filename was
jfs-validate-xattr-entry-bounds-before-replacing-an-attribute.patch
This patch was dropped because it was withdrawn
------------------------------------------------------
From: Andrew Morton <akpm@linux-foundation.org>
Subject: jfs: validate xattr entry bounds before replacing an attribute
Date: Sat, 21 Nov 2026 22:09:53 -0800
ea_get() checks the size of a JFS extended attribute list against the
inode EA descriptor, but __jfs_setxattr() does not check the boundaries
of the entries within that list. A malformed entry can claim more bytes
than remain in the list. When that entry matches the name being replaced,
__jfs_setxattr() subtracts its untrusted size from xattr_size and writes
the new entry before the allocated buffer. The later size consistency
check runs after the damage is done.
Seonggwon Yoon reproduced this with a 5021-byte list whose matching
entry's value length was changed from 5000 to 5020. Its computed size
became 5037 bytes, leaving xattr_size at -16. A setxattr() on the
malformed JFS root inode then wrote 16 bytes before the kmalloc buffer.
The report observed four KASAN invalid writes on v7.3.4 and v7.4-rc2.
JFS cannot be mounted directly from an unprivileged user namespace.
UDisks2 is used by familiar desktop file managers: GNOME Files gets disk
information through GVfs's UDisks2 monitor [3], while KDE Plasma's device
UI and Dolphin use Solid's UDisks2 backend [4][5]. On installations whose
policy permits an active local user to set up a loop device from a file
and request a mount through UDisks2 [2], its privileged daemon can mount
a crafted JFS image supplied by that user. If the affected inode permits
that user to set an attribute, the write is reachable without the user
having mount privilege. The route depends on policy and JFS availability;
the reported reproducer ran setxattr() as root.
Reject a nonempty list shorter than its header. Before examining each
entry, check that the fixed fields and the entire encoded name and value
fit in the remaining list bytes. This also checks entries after the
matching one before any move or replacement write. Return EUCLEAN for a
malformed list; valid xattr updates retain their existing behavior.
An earlier patch by Sebastian Alba Vives [1] identified the missing
entry bounds check. This version checks the fixed fields before reading
the encoded entry size and also checks the outer header length.
Link: https://lore.kernel.org/r/20260413140328.173446-1-sebasjosue84@gmail.com [1]
Link: https://storaged.org/udisks/docs/udisks-polkit-actions.html [2]
Link: https://github.com/GNOME/gvfs/blob/master/monitor/udisks2/what-is-shown.txt [3]
Link: https://develop.kde.org/docs/features/solid/ [4]
Link: https://codebrowser.dev/kde/solid/src/solid/devices/backends/udisks2/udisksmanager.cpp.html [5]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Seonggwon Yoon <keyakoto@gmail.com>
Cc: Dave Kleikamp <shaggy@kernel.org>
Cc: Sebastian Alba Vives <sebasjosue84@gmail.com>
Cc: Jori Koolstra <jkoolstra@xs4all.nl>
Cc: <stable@vger.kernel.org>
fs/jfs/xattr.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
--- a/fs/jfs/xattr.c~jfs-validate-xattr-entry-bounds-before-replacing-an-attribute
+++ a/fs/jfs/xattr.c
@@ -687,9 +687,24 @@ int __jfs_setxattr(tid_t tid, struct ino
ealist = (struct jfs_ea_list *) ea_buf.xattr;
new_size = sizeof (struct jfs_ea_list);
+ if (xattr_size && xattr_size < sizeof(*ealist)) {
+ rc = -EUCLEAN;
+ goto release;
+ }
+
if (xattr_size) {
- for (ea = FIRST_EA(ealist); ea < END_EALIST(ealist);
+ char *end = (char *)ealist + xattr_size;
+
+ for (ea = FIRST_EA(ealist); (char *)ea < end;
ea = NEXT_EA(ea)) {
+ size_t remaining = end - (char *)ea;
+
+ if (remaining < sizeof(*ea) ||
+ EA_SIZE(ea) > remaining) {
+ rc = -EUCLEAN;
+ goto release;
+ }
+
if ((namelen == ea->namelen) &&
(memcmp(name, ea->name, namelen) == 0)) {
found = 1;
_
Patches currently in -mm which might be from akpm@linux-foundation.org are
kselftest-mm-rename-read_pmd_pagesize-to-pmd_psize-fix.patch
selftests-mm-check-madv_cold-and-madv_pageout-on-partly-advised-thps-fix.patch
selftests-mm-retain-move-pmd-coverage-and-verify-huge-pmds.patch
lib-test_xarray-check-unused-spare-node-after-range-creation.patch
selftests-mm-check-that-fsync-reports-hard-poisoned-dirty-page-cache.patch
selftests-mm-memory-failure-truncate-poisoned-fuse-page-cache-before-teardown.patch
selftests-mm-memory-failure-skip-poisoned-dirty-page-cache-on-nilfs2.patch
selftest-mm-memory-failure-keep-page-cache-files-linked-until-cleanup.patch
selftest-mm-memory-failure-keep-page-cache-files-linked-until-cleanup-fix.patch
selftests-mm-memory-failure-skip-hard-dirty-page-cache-test-on-cephfs.patch
selftests-mm-memory-failure-close-dirty-page-cache-files-before-unlinking-them.patch
selftests-mm-memory-failure-extend-page-cache-test-files-with-pwrite.patch
selftests-mm-memory-failure-write-the-whole-page-cache-test-file-for-omfs.patch
selftests-mm-memory-failure-accept-eio-from-close-after-poisoning-dirty-data.patch
selftests-mm-test-mlock-and-munlock-range-normalisation-fix.patch
selftests-mm-free-the-test-context-when-uffd_test_ctx_init-fails-fix.patch
lib-test_hmm-serialize-chunk-removal-with-migration.patch
alloc_tag-introduce-ioctls-to-toggle-allocation-tracepoints-fix-fix.patch
alloc_tag-introduce-ioctls-to-toggle-allocation-tracepoints-fix.patch
mm-vmscan-scope-freeze-writeback-skip-to-the-reclaim-target.patch
mm-vmscan-scope-freeze-writeback-skip-to-the-reclaim-target-fix.patch
mm-hmm-refuse-secretmem-vmas-in-hmm_range_fault-fix.patch
hugetlbfs-dont-overflow-the-end-of-the-unmap-range-on-32-bit-fix.patch
mm-memory-failure-dont-leave-a-filtered-hugetlb-page-poisoned.patch
ipc-msg-clamp-negative-msg_info-usage-counts.patch
squashfs-fix-leaked-page-locks-when-page-actor-allocation-fails-fix.patch
ocfs2-skip-network-flush-when-no-domain-handlers-are-registered.patch
selftests-ptrace-check-that-ptrace_set_syscall_info-rejects-invalid-error-values-fix.patch
lib-atomic64-separate-hashed-locks-by-smp-cache-line.patch
nvdimm-btt-separate-map-locks-by-smp-cache-line.patch
percpu_ref-replace-the-global-switch-lock-with-hashed-locks-fix.patch
afs-do-not-put-error-pointer-after-address-lookup-failure.patch
drivers-media-v4l2-core-v4l2-vp9c-reduce-inlining.patch
reply other threads:[~2026-12-06 1:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261206014033.D19251F0092B@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=jkoolstra@xs4all.nl \
--cc=keyakoto@gmail.com \
--cc=mm-commits@vger.kernel.org \
--cc=sebasjosue84@gmail.com \
--cc=shaggy@kernel.org \
--cc=stable@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.