-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 258990 b: refs/heads/master c: 548f0a4 h: refs/heads/master v: v3
- Loading branch information
Richard Weinberger
authored and
Linus Torvalds
committed
Jul 26, 2011
1 parent
d4e7f98
commit 363cc94
Showing
4 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: b743ac54e54ca18fb7164a97cc77cf1ccee0b0f7 | ||
refs/heads/master: 548f0a4e02f6fa33278e77a2a6477cdeb512317f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (C) 2011 Richard Weinberger <richrd@nod.at> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#include <linux/mm.h> | ||
#include <asm/page.h> | ||
#include <asm/mman.h> | ||
|
||
static struct vm_area_struct gate_vma; | ||
|
||
static int __init gate_vma_init(void) | ||
{ | ||
if (!FIXADDR_USER_START) | ||
return 0; | ||
|
||
gate_vma.vm_mm = NULL; | ||
gate_vma.vm_start = FIXADDR_USER_START; | ||
gate_vma.vm_end = FIXADDR_USER_END; | ||
gate_vma.vm_flags = VM_READ | VM_MAYREAD | VM_EXEC | VM_MAYEXEC; | ||
gate_vma.vm_page_prot = __P101; | ||
|
||
/* | ||
* Make sure the vDSO gets into every core dump. | ||
* Dumping its contents makes post-mortem fully interpretable later | ||
* without matching up the same kernel and hardware config to see | ||
* what PC values meant. | ||
*/ | ||
gate_vma.vm_flags |= VM_ALWAYSDUMP; | ||
|
||
return 0; | ||
} | ||
__initcall(gate_vma_init); | ||
|
||
struct vm_area_struct *get_gate_vma(struct mm_struct *mm) | ||
{ | ||
return FIXADDR_USER_START ? &gate_vma : NULL; | ||
} | ||
|
||
int in_gate_area_no_mm(unsigned long addr) | ||
{ | ||
if (!FIXADDR_USER_START) | ||
return 0; | ||
|
||
if ((addr >= FIXADDR_USER_START) && (addr < FIXADDR_USER_END)) | ||
return 1; | ||
|
||
return 0; | ||
} | ||
|
||
int in_gate_area(struct mm_struct *mm, unsigned long addr) | ||
{ | ||
struct vm_area_struct *vma = get_gate_vma(mm); | ||
|
||
if (!vma) | ||
return 0; | ||
|
||
return (addr >= vma->vm_start) && (addr < vma->vm_end); | ||
} |