Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f268fe73
Commit
f268fe73
authored
Feb 13, 2009
by
Ingo Molnar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'x86/mm' into x86/core
parents
a56cdcb6
0464ac9e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
arch/x86/mm/fault.c
arch/x86/mm/fault.c
+16
-5
No files found.
arch/x86/mm/fault.c
View file @
f268fe73
...
@@ -782,6 +782,15 @@ static inline int access_error(unsigned long error_code, int write,
...
@@ -782,6 +782,15 @@ static inline int access_error(unsigned long error_code, int write,
return
0
;
return
0
;
}
}
static
int
fault_in_kernel_space
(
unsigned
long
address
)
{
#ifdef CONFIG_X86_32
return
address
>=
TASK_SIZE
;
#else
/* !CONFIG_X86_32 */
return
address
>=
TASK_SIZE64
;
#endif
/* CONFIG_X86_32 */
}
/*
/*
* This routine handles page faults. It determines the address,
* This routine handles page faults. It determines the address,
* and the problem, and then passes it off to one of the appropriate
* and the problem, and then passes it off to one of the appropriate
...
@@ -822,11 +831,7 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
...
@@ -822,11 +831,7 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
* (error_code & 4) == 0, and that the fault was not a
* (error_code & 4) == 0, and that the fault was not a
* protection error (error_code & 9) == 0.
* protection error (error_code & 9) == 0.
*/
*/
#ifdef CONFIG_X86_32
if
(
unlikely
(
fault_in_kernel_space
(
address
)))
{
if
(
unlikely
(
address
>=
TASK_SIZE
))
{
#else
if
(
unlikely
(
address
>=
TASK_SIZE64
))
{
#endif
if
(
!
(
error_code
&
(
PF_RSVD
|
PF_USER
|
PF_PROT
))
&&
if
(
!
(
error_code
&
(
PF_RSVD
|
PF_USER
|
PF_PROT
))
&&
vmalloc_fault
(
address
)
>=
0
)
vmalloc_fault
(
address
)
>=
0
)
return
;
return
;
...
@@ -898,6 +903,12 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
...
@@ -898,6 +903,12 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
return
;
return
;
}
}
down_read
(
&
mm
->
mmap_sem
);
down_read
(
&
mm
->
mmap_sem
);
}
else
{
/*
* The above down_read_trylock() might have succeeded in which
* case we'll have missed the might_sleep() from down_read().
*/
might_sleep
();
}
}
vma
=
find_vma
(
mm
,
address
);
vma
=
find_vma
(
mm
,
address
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment