From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796521234; b=SPkkzjGbiJ9mLfBzP9++u9Y2QosfpFCAdrYJxHXs8T0reY6EZzcwug7TQCc/SrKVUT9M BGXlR1dNFRi2gsCOiRKFotoNv2Ug/9w4AEboQxqqum+8MsksEonV5WbJxl1YmTvur/ApH DYg+7eyTQWzvbr1yKo4n8HDOETjDXkwH/dsrcrcgO2ovn3O0h8/LGwt1ydVx+SYFyPt8v ZWeRss1LexHwxJilNT/rr8bGpXsM5nnWjNhEX0kWuBKcTqkXZkNkIV+GVBG5u4HjGza3y m/8iDJgzPZ6Q+thptMWvQcII3Y7G+9XJ+ta0N3hl4n5z3N+one+BgxQnDaMg+OymmcA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796521234; h=Received:DKIM-Signature:Date:To:From:Subject:Message-Id; bh=vrgaOKgm7qOPt1ifnwvn+FWS1EbraUjdMLXXVHVgz50=; b=1G9QkAzTIAVfOZjKPpro7ZQk3Tmz9FPT/bLDJ8mJmAArw2odolbRkLTwPn6ZDVzAxTYL iUsp0qnRs8OfaF7PUgVNuq9WeIJa69LGuMUTiiq8UQ0y5xQZi0YsqFFKcRsxGjgtMCrrY cZa+V9FBUZdAIk9jHIxcjcefIbo2SQHVJ2iyhSk++3oiFsD2jFGqA8gEOsRh698VjD77b TfstHxNokhvLMKZfDTSc7cRpHjkkGgL5wenTDOiiGIDJ82AieYz6F/7aRaVTEixWGHiuC wV0czZNpEdup919/aQxodbwXPJAkNwe9BgrkTqgC3gmAD5ydydwmL++2QQaPXQGymZw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=kRai2lGf; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77631606A31F; Sun, 6 Dec 2026 01:40:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=kRai2lGf Received: by smtp.kernel.org (Postfix) with ESMTPSA id D19251F0092B; Sun, 6 Dec 2026 01:40:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796521233; bh=vrgaOKgm7qOPt1ifnwvn+FWS1EbraUjdMLXXVHVgz50=; h=Date:To:From:Subject; b=kRai2lGf8A0J5AWwFrG2s+zPJhwJ2OdAjfQbZOUdoAqUA/yZ+R+zfD5rBWCBfdvEs yVOLRDMDEoJw1USHOwZZJ+9CNZUsWVxQBY3shSwdK2BvbOoQX4VN57immYk4YD8eiN 3um0wiUGNfGLGdHbAfOK8b7eyX5vfkAWtvgi6tSw= Date: Sat, 05 Dec 2026 17:40:33 -0800 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 From: Andrew Morton Subject: [withdrawn] jfs-validate-xattr-entry-bounds-before-replacing-an-attribute.patch removed from -mm tree Message-Id: <20261206014033.D19251F0092B@smtp.kernel.org> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 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 Reported-by: Seonggwon Yoon Cc: Dave Kleikamp Cc: Sebastian Alba Vives Cc: Jori Koolstra Cc: 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