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
c0648e02
Commit
c0648e02
authored
Sep 29, 2009
by
Ralf Baechle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MIPS: VPE: Fix build after the credential changes a while ago.
Signed-off-by:
Ralf Baechle
<
ralf@linux-mips.org
>
parent
b7a05871
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
arch/mips/kernel/kspd.c
arch/mips/kernel/kspd.c
+23
-10
No files found.
arch/mips/kernel/kspd.c
View file @
c0648e02
...
...
@@ -172,13 +172,20 @@ static unsigned int translate_open_flags(int flags)
}
static
void
sp_setfsuidgid
(
uid_t
uid
,
gid_t
gid
)
static
int
sp_setfsuidgid
(
uid_t
uid
,
gid_t
gid
)
{
current
->
cred
->
fsuid
=
uid
;
current
->
cred
->
fsgid
=
gid
;
struct
cred
*
new
;
key_fsuid_changed
(
current
);
key_fsgid_changed
(
current
);
new
=
prepare_creds
();
if
(
!
new
)
return
-
ENOMEM
;
new
->
fsuid
=
uid
;
new
->
fsgid
=
gid
;
commit_creds
(
new
);
return
0
;
}
/*
...
...
@@ -196,7 +203,7 @@ void sp_work_handle_request(void)
mm_segment_t
old_fs
;
struct
timeval
tv
;
struct
timezone
tz
;
int
cmd
;
int
err
,
cmd
;
char
*
vcwd
;
int
size
;
...
...
@@ -225,8 +232,11 @@ void sp_work_handle_request(void)
/* Run the syscall at the privilege of the user who loaded the
SP program */
if
(
vpe_getuid
(
tclimit
))
sp_setfsuidgid
(
vpe_getuid
(
tclimit
),
vpe_getgid
(
tclimit
));
if
(
vpe_getuid
(
tclimit
))
{
err
=
sp_setfsuidgid
(
vpe_getuid
(
tclimit
),
vpe_getgid
(
tclimit
));
if
(
!
err
)
pr_err
(
"Change of creds failed
\n
"
);
}
switch
(
sc
.
cmd
)
{
/* needs the flags argument translating from SDE kit to
...
...
@@ -283,8 +293,11 @@ void sp_work_handle_request(void)
break
;
}
/* switch */
if
(
vpe_getuid
(
tclimit
))
sp_setfsuidgid
(
0
,
0
);
if
(
vpe_getuid
(
tclimit
))
{
err
=
sp_setfsuidgid
(
0
,
0
);
if
(
!
err
)
pr_err
(
"restoring old creds failed
\n
"
);
}
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
...
...
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