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
ec6fd8a4
Commit
ec6fd8a4
authored
Feb 15, 2011
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
report errors in /proc/*/*map* sanely
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
ca6b0bf0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
+13
-11
fs/proc/base.c
fs/proc/base.c
+5
-3
fs/proc/task_mmu.c
fs/proc/task_mmu.c
+5
-5
fs/proc/task_nommu.c
fs/proc/task_nommu.c
+3
-3
No files found.
fs/proc/base.c
View file @
ec6fd8a4
...
...
@@ -225,15 +225,17 @@ static int check_mem_permission(struct task_struct *task)
struct
mm_struct
*
mm_for_maps
(
struct
task_struct
*
task
)
{
struct
mm_struct
*
mm
;
int
err
;
if
(
mutex_lock_killable
(
&
task
->
signal
->
cred_guard_mutex
))
return
NULL
;
err
=
mutex_lock_killable
(
&
task
->
signal
->
cred_guard_mutex
);
if
(
err
)
return
ERR_PTR
(
err
);
mm
=
get_task_mm
(
task
);
if
(
mm
&&
mm
!=
current
->
mm
&&
!
ptrace_may_access
(
task
,
PTRACE_MODE_READ
))
{
mmput
(
mm
);
mm
=
NULL
;
mm
=
ERR_PTR
(
-
EACCES
)
;
}
mutex_unlock
(
&
task
->
signal
->
cred_guard_mutex
);
...
...
fs/proc/task_mmu.c
View file @
ec6fd8a4
...
...
@@ -119,11 +119,11 @@ static void *m_start(struct seq_file *m, loff_t *pos)
priv
->
task
=
get_pid_task
(
priv
->
pid
,
PIDTYPE_PID
);
if
(
!
priv
->
task
)
return
NULL
;
return
ERR_PTR
(
-
ESRCH
)
;
mm
=
mm_for_maps
(
priv
->
task
);
if
(
!
mm
)
return
NULL
;
if
(
!
mm
||
IS_ERR
(
mm
)
)
return
mm
;
down_read
(
&
mm
->
mmap_sem
);
tail_vma
=
get_gate_vma
(
priv
->
task
);
...
...
@@ -728,9 +728,9 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
if
(
!
task
)
goto
out
;
ret
=
-
EACCES
;
mm
=
mm_for_maps
(
task
);
if
(
!
mm
)
ret
=
PTR_ERR
(
mm
);
if
(
!
mm
||
IS_ERR
(
mm
))
goto
out_task
;
ret
=
-
EINVAL
;
...
...
fs/proc/task_nommu.c
View file @
ec6fd8a4
...
...
@@ -199,13 +199,13 @@ static void *m_start(struct seq_file *m, loff_t *pos)
/* pin the task and mm whilst we play with them */
priv
->
task
=
get_pid_task
(
priv
->
pid
,
PIDTYPE_PID
);
if
(
!
priv
->
task
)
return
NULL
;
return
ERR_PTR
(
-
ESRCH
)
;
mm
=
mm_for_maps
(
priv
->
task
);
if
(
!
mm
)
{
if
(
!
mm
||
IS_ERR
(
mm
)
)
{
put_task_struct
(
priv
->
task
);
priv
->
task
=
NULL
;
return
NULL
;
return
mm
;
}
down_read
(
&
mm
->
mmap_sem
);
...
...
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