Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'mm-hotfixes-stable-2025-01-16-21-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc fixes from Andrew Morton:
"7 singleton hotfixes. 6 are MM.

Two are cc:stable and the remainder address post-6.12 issues"

* tag 'mm-hotfixes-stable-2025-01-16-21-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
ocfs2: check dir i_size in ocfs2_find_entry
mailmap: update entry for Ethan Carter Edwards
mm: zswap: move allocations during CPU init outside the lock
mm: khugepaged: fix call hpage_collapse_scan_file() for anonymous vma
mm: shmem: use signed int for version handling in casefold option
alloc_tag: skip pgalloc_tag_swap if profiling is disabled
mm: page_alloc: fix missed updates of lowmem_reserve in adjust_managed_page_count

+55 -25
+1
.mailmap
··· 202 202 Enric Balletbo i Serra <eballetbo@kernel.org> <enric.balletbo@collabora.com> 203 203 Enric Balletbo i Serra <eballetbo@kernel.org> <eballetbo@iseebcn.com> 204 204 Erik Kaneda <erik.kaneda@intel.com> <erik.schmauss@intel.com> 205 + Ethan Carter Edwards <ethan@ethancedwards.com> Ethan Edwards <ethancarteredwards@gmail.com> 205 206 Eugen Hristev <eugen.hristev@linaro.org> <eugen.hristev@microchip.com> 206 207 Eugen Hristev <eugen.hristev@linaro.org> <eugen.hristev@collabora.com> 207 208 Evgeniy Polyakov <johnpol@2ka.mipt.ru>
+21 -4
fs/ocfs2/dir.c
··· 1065 1065 { 1066 1066 struct buffer_head *bh; 1067 1067 struct ocfs2_dir_entry *res_dir = NULL; 1068 + int ret = 0; 1068 1069 1069 1070 if (ocfs2_dir_indexed(dir)) 1070 1071 return ocfs2_find_entry_dx(name, namelen, dir, lookup); 1071 1072 1073 + if (unlikely(i_size_read(dir) <= 0)) { 1074 + ret = -EFSCORRUPTED; 1075 + mlog_errno(ret); 1076 + goto out; 1077 + } 1072 1078 /* 1073 1079 * The unindexed dir code only uses part of the lookup 1074 1080 * structure, so there's no reason to push it down further 1075 1081 * than this. 1076 1082 */ 1077 - if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) 1083 + if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { 1084 + if (unlikely(i_size_read(dir) > dir->i_sb->s_blocksize)) { 1085 + ret = -EFSCORRUPTED; 1086 + mlog_errno(ret); 1087 + goto out; 1088 + } 1078 1089 bh = ocfs2_find_entry_id(name, namelen, dir, &res_dir); 1079 - else 1090 + } else { 1080 1091 bh = ocfs2_find_entry_el(name, namelen, dir, &res_dir); 1092 + } 1081 1093 1082 1094 if (bh == NULL) 1083 1095 return -ENOENT; 1084 1096 1085 1097 lookup->dl_leaf_bh = bh; 1086 1098 lookup->dl_entry = res_dir; 1087 - return 0; 1099 + out: 1100 + return ret; 1088 1101 } 1089 1102 1090 1103 /* ··· 2023 2010 * 2024 2011 * Return 0 if the name does not exist 2025 2012 * Return -EEXIST if the directory contains the name 2013 + * Return -EFSCORRUPTED if found corruption 2026 2014 * 2027 2015 * Callers should have i_rwsem + a cluster lock on dir 2028 2016 */ ··· 2037 2023 trace_ocfs2_check_dir_for_entry( 2038 2024 (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name); 2039 2025 2040 - if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0) { 2026 + ret = ocfs2_find_entry(name, namelen, dir, &lookup); 2027 + if (ret == 0) { 2041 2028 ret = -EEXIST; 2042 2029 mlog_errno(ret); 2030 + } else if (ret == -ENOENT) { 2031 + ret = 0; 2043 2032 } 2044 2033 2045 2034 ocfs2_free_dir_lookup_result(&lookup);
+3
lib/alloc_tag.c
··· 195 195 union codetag_ref ref_old, ref_new; 196 196 struct alloc_tag *tag_old, *tag_new; 197 197 198 + if (!mem_alloc_profiling_enabled()) 199 + return; 200 + 198 201 tag_old = pgalloc_tag_get(&old->page); 199 202 if (!tag_old) 200 203 return;
+2 -2
mm/khugepaged.c
··· 2422 2422 VM_BUG_ON(khugepaged_scan.address < hstart || 2423 2423 khugepaged_scan.address + HPAGE_PMD_SIZE > 2424 2424 hend); 2425 - if (IS_ENABLED(CONFIG_SHMEM) && vma->vm_file) { 2425 + if (IS_ENABLED(CONFIG_SHMEM) && !vma_is_anonymous(vma)) { 2426 2426 struct file *file = get_file(vma->vm_file); 2427 2427 pgoff_t pgoff = linear_page_index(vma, 2428 2428 khugepaged_scan.address); ··· 2768 2768 mmap_assert_locked(mm); 2769 2769 memset(cc->node_load, 0, sizeof(cc->node_load)); 2770 2770 nodes_clear(cc->alloc_nmask); 2771 - if (IS_ENABLED(CONFIG_SHMEM) && vma->vm_file) { 2771 + if (IS_ENABLED(CONFIG_SHMEM) && !vma_is_anonymous(vma)) { 2772 2772 struct file *file = get_file(vma->vm_file); 2773 2773 pgoff_t pgoff = linear_page_index(vma, addr); 2774 2774
+3
mm/page_alloc.c
··· 5692 5692 zone->present_pages, zone_batchsize(zone)); 5693 5693 } 5694 5694 5695 + static void setup_per_zone_lowmem_reserve(void); 5696 + 5695 5697 void adjust_managed_page_count(struct page *page, long count) 5696 5698 { 5697 5699 atomic_long_add(count, &page_zone(page)->managed_pages); 5698 5700 totalram_pages_add(count); 5701 + setup_per_zone_lowmem_reserve(); 5699 5702 } 5700 5703 EXPORT_SYMBOL(adjust_managed_page_count); 5701 5704
+1 -1
mm/shmem.c
··· 4368 4368 bool latest_version) 4369 4369 { 4370 4370 struct shmem_options *ctx = fc->fs_private; 4371 - unsigned int version = UTF8_LATEST; 4371 + int version = UTF8_LATEST; 4372 4372 struct unicode_map *encoding; 4373 4373 char *version_str = param->string + 5; 4374 4374
+24 -18
mm/zswap.c
··· 820 820 { 821 821 struct zswap_pool *pool = hlist_entry(node, struct zswap_pool, node); 822 822 struct crypto_acomp_ctx *acomp_ctx = per_cpu_ptr(pool->acomp_ctx, cpu); 823 - struct crypto_acomp *acomp; 824 - struct acomp_req *req; 823 + struct crypto_acomp *acomp = NULL; 824 + struct acomp_req *req = NULL; 825 + u8 *buffer = NULL; 825 826 int ret; 826 827 827 - mutex_lock(&acomp_ctx->mutex); 828 - acomp_ctx->buffer = kmalloc_node(PAGE_SIZE * 2, GFP_KERNEL, cpu_to_node(cpu)); 829 - if (!acomp_ctx->buffer) { 828 + buffer = kmalloc_node(PAGE_SIZE * 2, GFP_KERNEL, cpu_to_node(cpu)); 829 + if (!buffer) { 830 830 ret = -ENOMEM; 831 - goto buffer_fail; 831 + goto fail; 832 832 } 833 833 834 834 acomp = crypto_alloc_acomp_node(pool->tfm_name, 0, 0, cpu_to_node(cpu)); ··· 836 836 pr_err("could not alloc crypto acomp %s : %ld\n", 837 837 pool->tfm_name, PTR_ERR(acomp)); 838 838 ret = PTR_ERR(acomp); 839 - goto acomp_fail; 839 + goto fail; 840 840 } 841 - acomp_ctx->acomp = acomp; 842 - acomp_ctx->is_sleepable = acomp_is_async(acomp); 843 841 844 - req = acomp_request_alloc(acomp_ctx->acomp); 842 + req = acomp_request_alloc(acomp); 845 843 if (!req) { 846 844 pr_err("could not alloc crypto acomp_request %s\n", 847 845 pool->tfm_name); 848 846 ret = -ENOMEM; 849 - goto req_fail; 847 + goto fail; 850 848 } 851 - acomp_ctx->req = req; 852 849 850 + /* 851 + * Only hold the mutex after completing allocations, otherwise we may 852 + * recurse into zswap through reclaim and attempt to hold the mutex 853 + * again resulting in a deadlock. 854 + */ 855 + mutex_lock(&acomp_ctx->mutex); 853 856 crypto_init_wait(&acomp_ctx->wait); 857 + 854 858 /* 855 859 * if the backend of acomp is async zip, crypto_req_done() will wakeup 856 860 * crypto_wait_req(); if the backend of acomp is scomp, the callback ··· 863 859 acomp_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, 864 860 crypto_req_done, &acomp_ctx->wait); 865 861 862 + acomp_ctx->buffer = buffer; 863 + acomp_ctx->acomp = acomp; 864 + acomp_ctx->is_sleepable = acomp_is_async(acomp); 865 + acomp_ctx->req = req; 866 866 mutex_unlock(&acomp_ctx->mutex); 867 867 return 0; 868 868 869 - req_fail: 870 - crypto_free_acomp(acomp_ctx->acomp); 871 - acomp_fail: 872 - kfree(acomp_ctx->buffer); 873 - buffer_fail: 874 - mutex_unlock(&acomp_ctx->mutex); 869 + fail: 870 + if (acomp) 871 + crypto_free_acomp(acomp); 872 + kfree(buffer); 875 873 return ret; 876 874 } 877 875