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
bd028ecb
Commit
bd028ecb
authored
Jun 26, 2002
by
Paul Mackerras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PPC32: Fixes for bugs in exception handling in copy_to_user and clear_user.
parent
9a30d64b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
arch/ppc/lib/string.S
arch/ppc/lib/string.S
+16
-8
include/asm-ppc/uaccess.h
include/asm-ppc/uaccess.h
+6
-2
No files found.
arch/ppc/lib/string.S
View file @
bd028ecb
...
@@ -461,7 +461,7 @@ _GLOBAL(__copy_tofrom_user)
...
@@ -461,7 +461,7 @@ _GLOBAL(__copy_tofrom_user)
53
:
53
:
#if !defined(CONFIG_8xx)
#if !defined(CONFIG_8xx)
dcbt
r3
,
r4
dcbt
r3
,
r4
dcbz
r11
,
r6
54
:
dcbz
r11
,
r6
#endif
#endif
/*
had
to
move
these
to
keep
extable
in
order
*/
/*
had
to
move
these
to
keep
extable
in
order
*/
.
section
__ex_table
,
"a"
.
section
__ex_table
,
"a"
...
@@ -470,7 +470,9 @@ _GLOBAL(__copy_tofrom_user)
...
@@ -470,7 +470,9 @@ _GLOBAL(__copy_tofrom_user)
.
long
71
b
,
101
f
.
long
71
b
,
101
f
.
long
72
b
,
102
f
.
long
72
b
,
102
f
.
long
73
b
,
103
f
.
long
73
b
,
103
f
.
long
53
b
,
105
f
#if !defined(CONFIG_8xx)
.
long
54
b
,
105
f
#endif
.
text
.
text
/*
the
main
body
of
the
cacheline
loop
*/
/*
the
main
body
of
the
cacheline
loop
*/
COPY_16_BYTES_WITHEX
(0)
COPY_16_BYTES_WITHEX
(0)
...
@@ -613,11 +615,11 @@ _GLOBAL(__clear_user)
...
@@ -613,11 +615,11 @@ _GLOBAL(__clear_user)
add
r4
,
r0
,
r4
add
r4
,
r0
,
r4
subf
r6
,
r0
,
r6
subf
r6
,
r0
,
r6
srwi
r0
,
r4
,
2
srwi
r0
,
r4
,
2
andi
.
r4
,
r4
,
3
mtctr
r0
mtctr
r0
bdz
6
f
bdz
7
f
1
:
stwu
r5
,
4
(
r6
)
1
:
stwu
r5
,
4
(
r6
)
bdnz
1
b
bdnz
1
b
6
:
andi
.
r4
,
r4
,
3
/
*
clear
byte
sized
chunks
*/
/
*
clear
byte
sized
chunks
*/
7
:
cmpwi
0
,
r4
,
0
7
:
cmpwi
0
,
r4
,
0
beqlr
beqlr
...
@@ -626,14 +628,20 @@ _GLOBAL(__clear_user)
...
@@ -626,14 +628,20 @@ _GLOBAL(__clear_user)
8
:
stbu
r5
,
1
(
r6
)
8
:
stbu
r5
,
1
(
r6
)
bdnz
8
b
bdnz
8
b
blr
blr
99
:
li
r3
,-
EFAULT
90
:
mr
r3
,
r4
blr
91
:
mfctr
r3
slwi
r3
,
r3
,
2
add
r3
,
r3
,
r4
blr
92
:
mfctr
r3
blr
blr
.
section
__ex_table
,
"a"
.
section
__ex_table
,
"a"
.
align
2
.
align
2
.
long
11
b
,
9
9
b
.
long
11
b
,
9
0
b
.
long
1
b
,
9
9
b
.
long
1
b
,
9
1
b
.
long
8
b
,
9
9
b
.
long
8
b
,
9
2
b
.
text
.
text
_GLOBAL
(
__strncpy_from_user
)
_GLOBAL
(
__strncpy_from_user
)
...
...
include/asm-ppc/uaccess.h
View file @
bd028ecb
/*
/*
* BK Id:
SCCS/s.uaccess.h 1.8 09/11/01 18:10:06 paulus
* BK Id:
%F% %I% %G% %U% %#%
*/
*/
#ifdef __KERNEL__
#ifdef __KERNEL__
#ifndef _PPC_UACCESS_H
#ifndef _PPC_UACCESS_H
...
@@ -272,7 +272,11 @@ clear_user(void *addr, unsigned long size)
...
@@ -272,7 +272,11 @@ clear_user(void *addr, unsigned long size)
{
{
if
(
access_ok
(
VERIFY_WRITE
,
addr
,
size
))
if
(
access_ok
(
VERIFY_WRITE
,
addr
,
size
))
return
__clear_user
(
addr
,
size
);
return
__clear_user
(
addr
,
size
);
return
size
?
-
EFAULT
:
0
;
if
((
unsigned
long
)
addr
<
TASK_SIZE
)
{
unsigned
long
over
=
(
unsigned
long
)
addr
+
size
-
TASK_SIZE
;
return
__clear_user
(
addr
,
size
-
over
)
+
over
;
}
return
size
;
}
}
extern
int
__strncpy_from_user
(
char
*
dst
,
const
char
*
src
,
long
count
);
extern
int
__strncpy_from_user
(
char
*
dst
,
const
char
*
src
,
long
count
);
...
...
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