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
21fed407
Commit
21fed407
authored
Apr 11, 2003
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BRIDGE]: Kill excessive stack usage in br_ioctl.
parent
419c3e2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
15 deletions
+23
-15
net/bridge/br_ioctl.c
net/bridge/br_ioctl.c
+23
-15
No files found.
net/bridge/br_ioctl.c
View file @
21fed407
...
@@ -84,17 +84,20 @@ static int br_ioctl_device(struct net_bridge *br,
...
@@ -84,17 +84,20 @@ static int br_ioctl_device(struct net_bridge *br,
case
BRCTL_GET_PORT_LIST
:
case
BRCTL_GET_PORT_LIST
:
{
{
int
i
;
int
*
indices
;
int
indices
[
256
]
;
int
ret
=
0
;
for
(
i
=
0
;
i
<
256
;
i
++
)
indices
=
kmalloc
(
256
*
sizeof
(
int
),
GFP_KERNEL
);
indices
[
i
]
=
0
;
if
(
indices
==
NULL
)
return
-
ENOMEM
;
memset
(
indices
,
0
,
256
*
sizeof
(
int
));
br_get_port_ifindices
(
br
,
indices
);
br_get_port_ifindices
(
br
,
indices
);
if
(
copy_to_user
((
void
*
)
arg0
,
indices
,
256
*
sizeof
(
int
)))
if
(
copy_to_user
((
void
*
)
arg0
,
indices
,
256
*
sizeof
(
int
)))
ret
urn
-
EFAULT
;
ret
=
-
EFAULT
;
kfree
(
indices
);
return
0
;
return
ret
;
}
}
case
BRCTL_SET_BRIDGE_FORWARD_DELAY
:
case
BRCTL_SET_BRIDGE_FORWARD_DELAY
:
...
@@ -212,19 +215,24 @@ static int br_ioctl_deviceless(unsigned int cmd,
...
@@ -212,19 +215,24 @@ static int br_ioctl_deviceless(unsigned int cmd,
case
BRCTL_GET_BRIDGES
:
case
BRCTL_GET_BRIDGES
:
{
{
int
i
;
int
*
indices
;
int
indices
[
64
];
int
ret
=
0
;
for
(
i
=
0
;
i
<
64
;
i
++
)
indices
[
i
]
=
0
;
if
(
arg1
>
64
)
if
(
arg1
>
64
)
arg1
=
64
;
arg1
=
64
;
indices
=
kmalloc
(
arg1
*
sizeof
(
int
),
GFP_KERNEL
);
if
(
indices
==
NULL
)
return
-
ENOMEM
;
memset
(
indices
,
0
,
arg1
*
sizeof
(
int
));
arg1
=
br_get_bridge_ifindices
(
indices
,
arg1
);
arg1
=
br_get_bridge_ifindices
(
indices
,
arg1
);
if
(
copy_to_user
((
void
*
)
arg0
,
indices
,
arg1
*
sizeof
(
int
)))
return
-
EFAULT
;
return
arg1
;
ret
=
copy_to_user
((
void
*
)
arg0
,
indices
,
arg1
*
sizeof
(
int
))
?
-
EFAULT
:
arg1
;
kfree
(
indices
);
return
ret
;
}
}
case
BRCTL_ADD_BRIDGE
:
case
BRCTL_ADD_BRIDGE
:
...
...
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