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
Kirill Smelkov
linux
Commits
c4787237
Commit
c4787237
authored
May 28, 2004
by
Alexander Viro
Committed by
Linus Torvalds
May 28, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: partial mm/* __user annotation
parent
20158e4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
mm/mempolicy.c
mm/mempolicy.c
+13
-12
mm/mincore.c
mm/mincore.c
+1
-1
No files found.
mm/mempolicy.c
View file @
c4787237
...
...
@@ -126,7 +126,7 @@ static int mpol_check_policy(int mode, unsigned long *nodes)
}
/* Copy a node mask from user space. */
static
int
get_nodes
(
unsigned
long
*
nodes
,
unsigned
long
*
nmask
,
static
int
get_nodes
(
unsigned
long
*
nodes
,
unsigned
long
__user
*
nmask
,
unsigned
long
maxnode
,
int
mode
)
{
unsigned
long
k
;
...
...
@@ -334,7 +334,7 @@ static int mbind_range(struct vm_area_struct *vma, unsigned long start,
/* Change policy for a memory range */
asmlinkage
long
sys_mbind
(
unsigned
long
start
,
unsigned
long
len
,
unsigned
long
mode
,
unsigned
long
*
nmask
,
unsigned
long
maxnode
,
unsigned
long
__user
*
nmask
,
unsigned
long
maxnode
,
unsigned
flags
)
{
struct
vm_area_struct
*
vma
;
...
...
@@ -379,7 +379,7 @@ asmlinkage long sys_mbind(unsigned long start, unsigned long len,
}
/* Set the process memory policy */
asmlinkage
long
sys_set_mempolicy
(
int
mode
,
unsigned
long
*
nmask
,
asmlinkage
long
sys_set_mempolicy
(
int
mode
,
unsigned
long
__user
*
nmask
,
unsigned
long
maxnode
)
{
int
err
;
...
...
@@ -443,7 +443,7 @@ static int lookup_node(struct mm_struct *mm, unsigned long addr)
}
/* Copy a kernel node mask to user space */
static
int
copy_nodes_to_user
(
unsigned
long
*
user_
mask
,
unsigned
long
maxnode
,
static
int
copy_nodes_to_user
(
unsigned
long
__user
*
mask
,
unsigned
long
maxnode
,
void
*
nodes
,
unsigned
nbytes
)
{
unsigned
long
copy
=
ALIGN
(
maxnode
-
1
,
64
)
/
8
;
...
...
@@ -451,16 +451,17 @@ static int copy_nodes_to_user(unsigned long *user_mask, unsigned long maxnode,
if
(
copy
>
nbytes
)
{
if
(
copy
>
PAGE_SIZE
)
return
-
EINVAL
;
if
(
clear_user
((
char
*
)
user_
mask
+
nbytes
,
copy
-
nbytes
))
if
(
clear_user
((
char
__user
*
)
mask
+
nbytes
,
copy
-
nbytes
))
return
-
EFAULT
;
copy
=
nbytes
;
}
return
copy_to_user
(
user_
mask
,
nodes
,
copy
)
?
-
EFAULT
:
0
;
return
copy_to_user
(
mask
,
nodes
,
copy
)
?
-
EFAULT
:
0
;
}
/* Retrieve NUMA policy */
asmlinkage
long
sys_get_mempolicy
(
int
*
policy
,
unsigned
long
*
nmask
,
unsigned
long
maxnode
,
asmlinkage
long
sys_get_mempolicy
(
int
__user
*
policy
,
unsigned
long
__user
*
nmask
,
unsigned
long
maxnode
,
unsigned
long
addr
,
unsigned
long
flags
)
{
int
err
,
pval
;
...
...
@@ -524,12 +525,12 @@ asmlinkage long sys_get_mempolicy(int *policy,
#ifdef CONFIG_COMPAT
/* The other functions are compatible */
asmlinkage
long
compat_get_mempolicy
(
int
*
policy
,
unsigned
*
nmask
,
unsigned
maxnode
,
asmlinkage
long
compat_get_mempolicy
(
int
__user
*
policy
,
unsigned
__user
*
nmask
,
unsigned
maxnode
,
unsigned
addr
,
unsigned
flags
)
{
long
err
;
unsigned
long
*
nm
=
NULL
;
unsigned
long
__user
*
nm
=
NULL
;
if
(
nmask
)
nm
=
compat_alloc_user_space
(
ALIGN
(
maxnode
-
1
,
64
)
/
8
);
err
=
sys_get_mempolicy
(
policy
,
nm
,
maxnode
,
addr
,
flags
);
...
...
@@ -756,7 +757,7 @@ int __mpol_equal(struct mempolicy *a, struct mempolicy *b)
}
/* Slow path of a mpol destructor. */
extern
void
__mpol_free
(
struct
mempolicy
*
p
)
void
__mpol_free
(
struct
mempolicy
*
p
)
{
if
(
!
atomic_dec_and_test
(
&
p
->
refcnt
))
return
;
...
...
mm/mincore.c
View file @
c4787237
...
...
@@ -124,7 +124,7 @@ asmlinkage long sys_mincore(unsigned long start, size_t len,
goto
out
;
error
=
-
EFAULT
;
if
(
!
access_ok
(
VERIFY_WRITE
,
(
unsigned
long
)
vec
,
len
>>
PAGE_SHIFT
))
if
(
!
access_ok
(
VERIFY_WRITE
,
vec
,
len
>>
PAGE_SHIFT
))
goto
out
;
error
=
0
;
...
...
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