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
a3929484
Commit
a3929484
authored
May 10, 2020
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atm: move copyin from atm_getnames() into the caller
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
8c2348e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
20 deletions
+20
-20
net/atm/ioctl.c
net/atm/ioctl.c
+18
-1
net/atm/resources.c
net/atm/resources.c
+1
-18
net/atm/resources.h
net/atm/resources.h
+1
-1
No files found.
net/atm/ioctl.c
View file @
a3929484
...
...
@@ -56,6 +56,8 @@ static int do_vcc_ioctl(struct socket *sock, unsigned int cmd,
int
error
;
struct
list_head
*
pos
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
void
__user
*
buf
;
int
__user
*
len
;
vcc
=
ATM_SD
(
sock
);
switch
(
cmd
)
{
...
...
@@ -163,7 +165,22 @@ static int do_vcc_ioctl(struct socket *sock, unsigned int cmd,
goto
done
;
if
(
cmd
==
ATM_GETNAMES
)
{
error
=
atm_getnames
(
argp
,
compat
);
if
(
IS_ENABLED
(
CONFIG_COMPAT
)
&&
compat
)
{
#ifdef CONFIG_COMPAT
struct
compat_atm_iobuf
__user
*
ciobuf
=
argp
;
compat_uptr_t
cbuf
;
len
=
&
ciobuf
->
length
;
if
(
get_user
(
cbuf
,
&
ciobuf
->
buffer
))
return
-
EFAULT
;
buf
=
compat_ptr
(
cbuf
);
#endif
}
else
{
struct
atm_iobuf
__user
*
iobuf
=
argp
;
len
=
&
iobuf
->
length
;
if
(
get_user
(
buf
,
&
iobuf
->
buffer
))
return
-
EFAULT
;
}
error
=
atm_getnames
(
buf
,
len
);
}
else
{
error
=
atm_dev_ioctl
(
cmd
,
argp
,
compat
);
}
...
...
net/atm/resources.c
View file @
a3929484
...
...
@@ -193,30 +193,13 @@ static int fetch_stats(struct atm_dev *dev, struct atm_dev_stats __user *arg,
return
error
?
-
EFAULT
:
0
;
}
int
atm_getnames
(
void
__user
*
arg
,
int
compat
)
int
atm_getnames
(
void
__user
*
buf
,
int
__user
*
iobuf_len
)
{
void
__user
*
buf
;
int
error
,
len
,
size
=
0
;
struct
atm_dev
*
dev
;
struct
list_head
*
p
;
int
*
tmp_buf
,
*
tmp_p
;
int
__user
*
iobuf_len
;
if
(
IS_ENABLED
(
CONFIG_COMPAT
)
&&
compat
)
{
#ifdef CONFIG_COMPAT
struct
compat_atm_iobuf
__user
*
ciobuf
=
arg
;
compat_uptr_t
cbuf
;
iobuf_len
=
&
ciobuf
->
length
;
if
(
get_user
(
cbuf
,
&
ciobuf
->
buffer
))
return
-
EFAULT
;
buf
=
compat_ptr
(
cbuf
);
#endif
}
else
{
struct
atm_iobuf
__user
*
iobuf
=
arg
;
iobuf_len
=
&
iobuf
->
length
;
if
(
get_user
(
buf
,
&
iobuf
->
buffer
))
return
-
EFAULT
;
}
if
(
get_user
(
len
,
iobuf_len
))
return
-
EFAULT
;
mutex_lock
(
&
atm_dev_mutex
);
...
...
net/atm/resources.h
View file @
a3929484
...
...
@@ -14,7 +14,7 @@
extern
struct
list_head
atm_devs
;
extern
struct
mutex
atm_dev_mutex
;
int
atm_getnames
(
void
__user
*
arg
,
int
compat
);
int
atm_getnames
(
void
__user
*
buf
,
int
__user
*
iobuf_len
);
int
atm_dev_ioctl
(
unsigned
int
cmd
,
void
__user
*
arg
,
int
compat
);
...
...
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