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

Commit 31db58b3 authored by Stephen Wilson's avatar Stephen Wilson Committed by Al Viro
Browse files

mm: arch: make get_gate_vma take an mm_struct instead of a task_struct



Morally, the presence of a gate vma is more an attribute of a particular mm than
a particular task.  Moreover, dropping the dependency on task_struct will help
make both existing and future operations on mm's more flexible and convenient.

Signed-off-by: default avatarStephen Wilson <wilsons@start.ca>
Reviewed-by: default avatarMichel Lespinasse <walken@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 375906f8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -830,7 +830,7 @@ int in_gate_area(struct task_struct *task, unsigned long addr)
	return 0;
}

struct vm_area_struct *get_gate_vma(struct task_struct *tsk)
struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
{
	return NULL;
}
+1 −1
Original line number Diff line number Diff line
@@ -347,7 +347,7 @@ int in_gate_area(struct task_struct *task, unsigned long addr)
	return 0;
}

struct vm_area_struct *get_gate_vma(struct task_struct *tsk)
struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
{
	return NULL;
}
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ const char *arch_vma_name(struct vm_area_struct *vma)
	return NULL;
}

struct vm_area_struct *get_gate_vma(struct task_struct *task)
struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
{
	return NULL;
}
+3 −3
Original line number Diff line number Diff line
@@ -861,10 +861,10 @@ static struct vm_area_struct gate_vma = {
	.vm_flags	= VM_READ | VM_EXEC
};

struct vm_area_struct *get_gate_vma(struct task_struct *tsk)
struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
{
#ifdef CONFIG_IA32_EMULATION
	if (test_tsk_thread_flag(tsk, TIF_IA32))
	if (!mm || mm->context.ia32_compat)
		return NULL;
#endif
	return &gate_vma;
@@ -872,7 +872,7 @@ struct vm_area_struct *get_gate_vma(struct task_struct *tsk)

int in_gate_area(struct task_struct *task, unsigned long addr)
{
	struct vm_area_struct *vma = get_gate_vma(task);
	struct vm_area_struct *vma = get_gate_vma(task->mm);

	if (!vma)
		return 0;
+6 −5
Original line number Diff line number Diff line
@@ -417,11 +417,12 @@ const char *arch_vma_name(struct vm_area_struct *vma)
	return NULL;
}

struct vm_area_struct *get_gate_vma(struct task_struct *tsk)
struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
{
	struct mm_struct *mm = tsk->mm;

	/* Check to see if this task was created in compat vdso mode */
	/*
	 * Check to see if the corresponding task was created in compat vdso
	 * mode.
	 */
	if (mm && mm->context.vdso == (void *)VDSO_HIGH_BASE)
		return &gate_vma;
	return NULL;
@@ -429,7 +430,7 @@ struct vm_area_struct *get_gate_vma(struct task_struct *tsk)

int in_gate_area(struct task_struct *task, unsigned long addr)
{
	const struct vm_area_struct *vma = get_gate_vma(task);
	const struct vm_area_struct *vma = get_gate_vma(task->mm);

	return vma && addr >= vma->vm_start && addr < vma->vm_end;
}
Loading