Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b2614f1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'akpm' (patches from Andrew)

Merge more fixes from Andrew Morton:
 "6 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  scripts/dtc: fix '%zx' warning
  include/linux/compiler.h: don't perform compiletime_assert with -O0
  mm, madvise: ensure poisoned pages are removed from per-cpu lists
  mm, uprobes: fix multiple free of ->uprobes_state.xol_area
  kernel/kthread.c: kthread_worker: don't hog the cpu
  mm,page_alloc: don't call __node_reclaim() with oom_lock held.
parents ea25c431 e6618692
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -517,6 +517,7 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
# define __compiletime_error_fallback(condition) do { } while (0)
# define __compiletime_error_fallback(condition) do { } while (0)
#endif
#endif


#ifdef __OPTIMIZE__
# define __compiletime_assert(condition, msg, prefix, suffix)		\
# define __compiletime_assert(condition, msg, prefix, suffix)		\
	do {								\
	do {								\
		bool __cond = !(condition);				\
		bool __cond = !(condition);				\
@@ -525,6 +526,9 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
			prefix ## suffix();				\
			prefix ## suffix();				\
		__compiletime_error_fallback(__cond);			\
		__compiletime_error_fallback(__cond);			\
	} while (0)
	} while (0)
#else
# define __compiletime_assert(condition, msg, prefix, suffix) do { } while (0)
#endif


#define _compiletime_assert(condition, msg, prefix, suffix) \
#define _compiletime_assert(condition, msg, prefix, suffix) \
	__compiletime_assert(condition, msg, prefix, suffix)
	__compiletime_assert(condition, msg, prefix, suffix)
+0 −2
Original line number Original line Diff line number Diff line
@@ -1262,8 +1262,6 @@ void uprobe_end_dup_mmap(void)


void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm)
void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm)
{
{
	newmm->uprobes_state.xol_area = NULL;

	if (test_bit(MMF_HAS_UPROBES, &oldmm->flags)) {
	if (test_bit(MMF_HAS_UPROBES, &oldmm->flags)) {
		set_bit(MMF_HAS_UPROBES, &newmm->flags);
		set_bit(MMF_HAS_UPROBES, &newmm->flags);
		/* unconditionally, dup_mmap() skips VM_DONTCOPY vmas */
		/* unconditionally, dup_mmap() skips VM_DONTCOPY vmas */
+8 −0
Original line number Original line Diff line number Diff line
@@ -785,6 +785,13 @@ static void mm_init_owner(struct mm_struct *mm, struct task_struct *p)
#endif
#endif
}
}


static void mm_init_uprobes_state(struct mm_struct *mm)
{
#ifdef CONFIG_UPROBES
	mm->uprobes_state.xol_area = NULL;
#endif
}

static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p,
static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p,
	struct user_namespace *user_ns)
	struct user_namespace *user_ns)
{
{
@@ -812,6 +819,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p,
#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS
#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS
	mm->pmd_huge_pte = NULL;
	mm->pmd_huge_pte = NULL;
#endif
#endif
	mm_init_uprobes_state(mm);


	if (current->mm) {
	if (current->mm) {
		mm->flags = current->mm->flags & MMF_INIT_MASK;
		mm->flags = current->mm->flags & MMF_INIT_MASK;
+1 −0
Original line number Original line Diff line number Diff line
@@ -637,6 +637,7 @@ int kthread_worker_fn(void *worker_ptr)
		schedule();
		schedule();


	try_to_freeze();
	try_to_freeze();
	cond_resched();
	goto repeat;
	goto repeat;
}
}
EXPORT_SYMBOL_GPL(kthread_worker_fn);
EXPORT_SYMBOL_GPL(kthread_worker_fn);
+6 −0
Original line number Original line Diff line number Diff line
@@ -613,6 +613,7 @@ static int madvise_inject_error(int behavior,
		unsigned long start, unsigned long end)
		unsigned long start, unsigned long end)
{
{
	struct page *page;
	struct page *page;
	struct zone *zone;


	if (!capable(CAP_SYS_ADMIN))
	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;
		return -EPERM;
@@ -646,6 +647,11 @@ static int madvise_inject_error(int behavior,
		if (ret)
		if (ret)
			return ret;
			return ret;
	}
	}

	/* Ensure that all poisoned pages are removed from per-cpu lists */
	for_each_populated_zone(zone)
		drain_all_pages(zone);

	return 0;
	return 0;
}
}
#endif
#endif
Loading