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
4658bae8
Commit
4658bae8
authored
Jun 06, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sparc: Fix copy_{to,from}_user return value handling.
parent
3da9cf28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
arch/sparc64/kernel/sys_sparc32.c
arch/sparc64/kernel/sys_sparc32.c
+12
-10
arch/sparc64/kernel/sys_sunos32.c
arch/sparc64/kernel/sys_sunos32.c
+1
-1
No files found.
arch/sparc64/kernel/sys_sparc32.c
View file @
4658bae8
...
...
@@ -513,9 +513,9 @@ static int do_sys32_msgsnd (int first, int second, int third, void *uptr)
if
(
!
p
)
return
-
ENOMEM
;
err
=
get_user
(
p
->
mtype
,
&
up
->
mtype
)
;
err
|=
__copy_from_user
(
p
->
mtext
,
&
up
->
mtext
,
second
);
if
(
err
)
err
=
-
EFAULT
;
if
(
get_user
(
p
->
mtype
,
&
up
->
mtype
)
||
__copy_from_user
(
p
->
mtext
,
&
up
->
mtext
,
second
)
)
goto
out
;
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
...
...
@@ -2759,6 +2759,8 @@ sys32_rt_sigaction(int sig, struct sigaction32 *act, struct sigaction32 *oact,
ret
|=
__copy_to_user
(
&
oact
->
sa_mask
,
&
set32
,
sizeof
(
sigset_t32
));
ret
|=
__put_user
(
old_ka
.
sa
.
sa_flags
,
&
oact
->
sa_flags
);
ret
|=
__put_user
((
long
)
old_ka
.
sa
.
sa_restorer
,
&
oact
->
sa_restorer
);
if
(
ret
)
ret
=
-
EFAULT
;
}
return
ret
;
...
...
@@ -3494,7 +3496,7 @@ static int nfs_clnt32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
err
|=
copy_from_user
(
&
karg
->
ca_client
.
cl_fhkey
[
0
],
&
arg32
->
ca32_client
.
cl32_fhkey
[
0
],
NFSCLNT_KEYMAX
);
return
err
;
return
(
err
?
-
EFAULT
:
0
)
;
}
static
int
nfs_exp32_trans
(
struct
nfsctl_arg
*
karg
,
struct
nfsctl_arg32
*
arg32
)
...
...
@@ -3520,7 +3522,7 @@ static int nfs_exp32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
&
arg32
->
ca32_export
.
ex32_anon_gid
);
karg
->
ca_export
.
ex_anon_uid
=
high2lowuid
(
karg
->
ca_export
.
ex_anon_uid
);
karg
->
ca_export
.
ex_anon_gid
=
high2lowgid
(
karg
->
ca_export
.
ex_anon_gid
);
return
err
;
return
(
err
?
-
EFAULT
:
0
)
;
}
static
int
nfs_uud32_trans
(
struct
nfsctl_arg
*
karg
,
struct
nfsctl_arg32
*
arg32
)
...
...
@@ -3568,7 +3570,7 @@ static int nfs_uud32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
err
|=
__get_user
(
karg
->
ca_umap
.
ug_gdimap
[
i
],
&
(((
__kernel_gid_t32
*
)
A
(
uaddr
))[
i
]));
return
err
;
return
(
err
?
-
EFAULT
:
0
)
;
}
static
int
nfs_getfh32_trans
(
struct
nfsctl_arg
*
karg
,
struct
nfsctl_arg32
*
arg32
)
...
...
@@ -3585,7 +3587,7 @@ static int nfs_getfh32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32
&
arg32
->
ca32_getfh
.
gf32_ino
);
err
|=
__get_user
(
karg
->
ca_getfh
.
gf_version
,
&
arg32
->
ca32_getfh
.
gf32_version
);
return
err
;
return
(
err
?
-
EFAULT
:
0
)
;
}
static
int
nfs_getfd32_trans
(
struct
nfsctl_arg
*
karg
,
struct
nfsctl_arg32
*
arg32
)
...
...
@@ -3601,7 +3603,7 @@ static int nfs_getfd32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32
(
NFS_MAXPATHLEN
+
1
));
err
|=
__get_user
(
karg
->
ca_getfd
.
gd_version
,
&
arg32
->
ca32_getfd
.
gd32_version
);
return
err
;
return
(
err
?
-
EFAULT
:
0
)
;
}
static
int
nfs_getfs32_trans
(
struct
nfsctl_arg
*
karg
,
struct
nfsctl_arg32
*
arg32
)
...
...
@@ -3617,7 +3619,7 @@ static int nfs_getfs32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32
(
NFS_MAXPATHLEN
+
1
));
err
|=
__get_user
(
karg
->
ca_getfs
.
gd_maxlen
,
&
arg32
->
ca32_getfs
.
gd32_maxlen
);
return
err
;
return
(
err
?
-
EFAULT
:
0
)
;
}
/* This really doesn't need translations, we are only passing
...
...
@@ -3625,7 +3627,7 @@ static int nfs_getfs32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32
*/
static
int
nfs_getfh32_res_trans
(
union
nfsctl_res
*
kres
,
union
nfsctl_res32
*
res32
)
{
return
copy_to_user
(
res32
,
kres
,
sizeof
(
*
res32
)
);
return
(
copy_to_user
(
res32
,
kres
,
sizeof
(
*
res32
))
?
-
EFAULT
:
0
);
}
int
asmlinkage
sys32_nfsservctl
(
int
cmd
,
struct
nfsctl_arg32
*
arg32
,
union
nfsctl_res32
*
res32
)
...
...
arch/sparc64/kernel/sys_sunos32.c
View file @
4658bae8
...
...
@@ -445,7 +445,7 @@ asmlinkage int sunos_uname(struct sunos_utsname *name)
ret
|=
copy_to_user
(
&
name
->
ver
[
0
],
&
system_utsname
.
version
[
0
],
sizeof
(
name
->
ver
)
-
1
);
ret
|=
copy_to_user
(
&
name
->
mach
[
0
],
&
system_utsname
.
machine
[
0
],
sizeof
(
name
->
mach
)
-
1
);
up_read
(
&
uts_sem
);
return
ret
;
return
(
ret
?
-
EFAULT
:
0
)
;
}
asmlinkage
int
sunos_nosys
(
void
)
...
...
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