Commit c45323b7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'mm-hotfixes-stable-2025-01-13-00-03' of...

Merge tag 'mm-hotfixes-stable-2025-01-13-00-03' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc fixes from Andrew Morton:
 "18 hotfixes. 11 are cc:stable. 13 are MM and 5 are non-MM.

  All patches are singletons - please see the relevant changelogs for
  details"

* tag 'mm-hotfixes-stable-2025-01-13-00-03' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  fs/proc: fix softlockup in __read_vmcore (part 2)
  mm: fix assertion in folio_end_read()
  mm: vmscan : pgdemote vmstat is not getting updated when MGLRU is enabled.
  vmstat: disable vmstat_work on vmstat_cpu_down_prep()
  zram: fix potential UAF of zram table
  selftests/mm: set allocated memory to non-zero content in cow test
  mm: clear uffd-wp PTE/PMD state on mremap()
  module: fix writing of livepatch relocations in ROX text
  mm: zswap: properly synchronize freeing resources during CPU hotunplug
  Revert "mm: zswap: fix race between [de]compression and CPU hotunplug"
  hugetlb: fix NULL pointer dereference in trace_hugetlbfs_alloc_inode
  mm: fix div by zero in bdi_ratio_from_pages
  x86/execmem: fix ROX cache usage in Xen PV guests
  filemap: avoid truncating 64-bit offset to 32 bits
  tools: fix atomic_set() definition to set the value correctly
  mm/mempolicy: count MPOL_WEIGHTED_INTERLEAVE to "interleave_hit"
  scripts/decode_stacktrace.sh: fix decoding of lines with an additional info
  mm/kmemleak: fix percpu memory leak detection failure
parents 5bc55a33 cbc5dde0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1080,7 +1080,8 @@ struct execmem_info __init *execmem_arch_setup(void)

	start = MODULES_VADDR + offset;

	if (IS_ENABLED(CONFIG_ARCH_HAS_EXECMEM_ROX)) {
	if (IS_ENABLED(CONFIG_ARCH_HAS_EXECMEM_ROX) &&
	    cpu_feature_enabled(X86_FEATURE_PSE)) {
		pgprot = PAGE_KERNEL_ROX;
		flags = EXECMEM_KASAN_SHADOW | EXECMEM_ROX_CACHE;
	} else {
+1 −0
Original line number Diff line number Diff line
@@ -1468,6 +1468,7 @@ static bool zram_meta_alloc(struct zram *zram, u64 disksize)
	zram->mem_pool = zs_create_pool(zram->disk->disk_name);
	if (!zram->mem_pool) {
		vfree(zram->table);
		zram->table = NULL;
		return false;
	}

+2 −0
Original line number Diff line number Diff line
@@ -404,6 +404,8 @@ static ssize_t __read_vmcore(struct iov_iter *iter, loff_t *fpos)
			if (!iov_iter_count(iter))
				return acc;
		}

		cond_resched();
	}

	return acc;
+2 −1
Original line number Diff line number Diff line
@@ -773,7 +773,8 @@ void *__module_writable_address(struct module *mod, void *loc);

static inline void *module_writable_address(struct module *mod, void *loc)
{
	if (!IS_ENABLED(CONFIG_ARCH_HAS_EXECMEM_ROX) || !mod)
	if (!IS_ENABLED(CONFIG_ARCH_HAS_EXECMEM_ROX) || !mod ||
	    mod->state != MODULE_STATE_UNFORMED)
		return loc;
	return __module_writable_address(mod, loc);
}
+12 −0
Original line number Diff line number Diff line
@@ -247,6 +247,13 @@ static inline bool vma_can_userfault(struct vm_area_struct *vma,
	    vma_is_shmem(vma);
}

static inline bool vma_has_uffd_without_event_remap(struct vm_area_struct *vma)
{
	struct userfaultfd_ctx *uffd_ctx = vma->vm_userfaultfd_ctx.ctx;

	return uffd_ctx && (uffd_ctx->features & UFFD_FEATURE_EVENT_REMAP) == 0;
}

extern int dup_userfaultfd(struct vm_area_struct *, struct list_head *);
extern void dup_userfaultfd_complete(struct list_head *);
void dup_userfaultfd_fail(struct list_head *);
@@ -402,6 +409,11 @@ static inline bool userfaultfd_wp_async(struct vm_area_struct *vma)
	return false;
}

static inline bool vma_has_uffd_without_event_remap(struct vm_area_struct *vma)
{
	return false;
}

#endif /* CONFIG_USERFAULTFD */

static inline bool userfaultfd_wp_use_markers(struct vm_area_struct *vma)
Loading