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
6ae80eaa
Commit
6ae80eaa
authored
Oct 01, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge davem@nuts.ninka.net:/disk1/davem/BK/net-2.5
into kernel.bkbits.net:/home/davem/net-2.5
parents
7db66084
0141a137
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
35 deletions
+26
-35
fs/compat_ioctl.c
fs/compat_ioctl.c
+26
-35
No files found.
fs/compat_ioctl.c
View file @
6ae80eaa
...
@@ -576,54 +576,45 @@ static int ethtool_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
...
@@ -576,54 +576,45 @@ static int ethtool_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
static
int
bond_ioctl
(
unsigned
long
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
static
int
bond_ioctl
(
unsigned
long
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
{
struct
ifreq
ifr
;
struct
ifreq
kifr
;
struct
ifreq
*
uifr
;
struct
ifreq32
*
ifr32
=
(
struct
ifreq32
*
)
arg
;
mm_segment_t
old_fs
;
mm_segment_t
old_fs
;
int
err
,
len
;
int
err
;
u32
data
;
u32
data
;
void
*
datap
;
if
(
copy_from_user
(
&
ifr
,
(
struct
ifreq32
*
)
arg
,
sizeof
(
struct
ifreq32
)))
return
-
EFAULT
;
ifr
.
ifr_data
=
(
__kernel_caddr_t
)
get_zeroed_page
(
GFP_KERNEL
);
if
(
!
ifr
.
ifr_data
)
return
-
EAGAIN
;
switch
(
cmd
)
{
switch
(
cmd
)
{
case
SIOCBONDENSLAVE
:
case
SIOCBONDENSLAVE
:
case
SIOCBONDRELEASE
:
case
SIOCBONDRELEASE
:
case
SIOCBONDSETHWADDR
:
case
SIOCBONDSETHWADDR
:
case
SIOCBONDCHANGEACTIVE
:
case
SIOCBONDCHANGEACTIVE
:
len
=
IFNAMSIZ
*
sizeof
(
char
);
if
(
copy_from_user
(
&
kifr
,
ifr32
,
sizeof
(
struct
ifreq32
)))
break
;
return
-
EFAULT
;
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
&
kifr
);
set_fs
(
old_fs
);
return
err
;
case
SIOCBONDSLAVEINFOQUERY
:
case
SIOCBONDSLAVEINFOQUERY
:
len
=
sizeof
(
struct
ifslave
);
break
;
case
SIOCBONDINFOQUERY
:
case
SIOCBONDINFOQUERY
:
len
=
sizeof
(
struct
ifbond
);
uifr
=
compat_alloc_user_space
(
sizeof
(
*
uifr
));
break
;
if
(
copy_in_user
(
&
uifr
->
ifr_name
,
&
ifr32
->
ifr_name
,
IFNAMSIZ
))
default:
return
-
EFAULT
;
err
=
-
EINVAL
;
goto
out
;
};
__get_user
(
data
,
&
(((
struct
ifreq32
*
)
arg
)
->
ifr_ifru
.
ifru_data
));
if
(
get_user
(
data
,
&
ifr32
->
ifr_ifru
.
ifru_data
))
if
(
copy_from_user
(
ifr
.
ifr_data
,
compat_ptr
(
data
),
len
))
{
return
-
EFAULT
;
err
=
-
EFAULT
;
goto
out
;
}
old_fs
=
get_fs
();
datap
=
compat_ptr
(
data
);
set_fs
(
KERNEL_DS
);
if
(
put_user
(
datap
,
&
uifr
->
ifr_ifru
.
ifru_data
))
err
=
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
&
ifr
);
return
-
EFAULT
;
set_fs
(
old_fs
);
if
(
!
err
)
{
len
=
copy_to_user
(
compat_ptr
(
data
),
ifr
.
ifr_data
,
len
);
if
(
len
)
err
=
-
EFAULT
;
}
out:
return
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
uifr
);
free_page
((
unsigned
long
)
ifr
.
ifr_data
);
default:
return
err
;
return
-
EINVAL
;
};
}
}
int
siocdevprivate_ioctl
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
int
siocdevprivate_ioctl
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
...
...
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