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
8cacb416
Commit
8cacb416
authored
May 10, 2020
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atm: lift copyin from atm_dev_ioctl()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
36085049
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
33 deletions
+31
-33
net/atm/ioctl.c
net/atm/ioctl.c
+24
-1
net/atm/resources.c
net/atm/resources.c
+5
-30
net/atm/resources.h
net/atm/resources.h
+2
-2
No files found.
net/atm/ioctl.c
View file @
8cacb416
...
@@ -182,7 +182,30 @@ static int do_vcc_ioctl(struct socket *sock, unsigned int cmd,
...
@@ -182,7 +182,30 @@ static int do_vcc_ioctl(struct socket *sock, unsigned int cmd,
}
}
error
=
atm_getnames
(
buf
,
len
);
error
=
atm_getnames
(
buf
,
len
);
}
else
{
}
else
{
error
=
atm_dev_ioctl
(
cmd
,
argp
,
compat
);
int
number
;
if
(
IS_ENABLED
(
CONFIG_COMPAT
)
&&
compat
)
{
#ifdef CONFIG_COMPAT
struct
compat_atmif_sioc
__user
*
csioc
=
argp
;
compat_uptr_t
carg
;
len
=
&
csioc
->
length
;
if
(
get_user
(
carg
,
&
csioc
->
arg
))
return
-
EFAULT
;
buf
=
compat_ptr
(
carg
);
if
(
get_user
(
number
,
&
csioc
->
number
))
return
-
EFAULT
;
#endif
}
else
{
struct
atmif_sioc
__user
*
sioc
=
argp
;
len
=
&
sioc
->
length
;
if
(
get_user
(
buf
,
&
sioc
->
arg
))
return
-
EFAULT
;
if
(
get_user
(
number
,
&
sioc
->
number
))
return
-
EFAULT
;
}
error
=
atm_dev_ioctl
(
cmd
,
buf
,
len
,
number
,
compat
);
}
}
done:
done:
...
...
net/atm/resources.c
View file @
8cacb416
...
@@ -227,39 +227,14 @@ int atm_getnames(void __user *buf, int __user *iobuf_len)
...
@@ -227,39 +227,14 @@ int atm_getnames(void __user *buf, int __user *iobuf_len)
return
error
;
return
error
;
}
}
int
atm_dev_ioctl
(
unsigned
int
cmd
,
void
__user
*
arg
,
int
compat
)
int
atm_dev_ioctl
(
unsigned
int
cmd
,
void
__user
*
buf
,
int
__user
*
sioc_len
,
int
number
,
int
compat
)
{
{
void
__user
*
buf
;
int
error
,
len
,
size
=
0
;
int
error
,
len
,
number
,
size
=
0
;
struct
atm_dev
*
dev
;
struct
atm_dev
*
dev
;
int
__user
*
sioc_len
;
if
(
IS_ENABLED
(
CONFIG_COMPAT
)
&&
compat
)
{
if
(
get_user
(
len
,
sioc_len
))
#ifdef CONFIG_COMPAT
return
-
EFAULT
;
struct
compat_atmif_sioc
__user
*
csioc
=
arg
;
compat_uptr_t
carg
;
sioc_len
=
&
csioc
->
length
;
if
(
get_user
(
carg
,
&
csioc
->
arg
))
return
-
EFAULT
;
buf
=
compat_ptr
(
carg
);
if
(
get_user
(
len
,
&
csioc
->
length
))
return
-
EFAULT
;
if
(
get_user
(
number
,
&
csioc
->
number
))
return
-
EFAULT
;
#endif
}
else
{
struct
atmif_sioc
__user
*
sioc
=
arg
;
sioc_len
=
&
sioc
->
length
;
if
(
get_user
(
buf
,
&
sioc
->
arg
))
return
-
EFAULT
;
if
(
get_user
(
len
,
&
sioc
->
length
))
return
-
EFAULT
;
if
(
get_user
(
number
,
&
sioc
->
number
))
return
-
EFAULT
;
}
dev
=
try_then_request_module
(
atm_dev_lookup
(
number
),
"atm-device-%d"
,
dev
=
try_then_request_module
(
atm_dev_lookup
(
number
),
"atm-device-%d"
,
number
);
number
);
...
...
net/atm/resources.h
View file @
8cacb416
...
@@ -15,8 +15,8 @@ extern struct list_head atm_devs;
...
@@ -15,8 +15,8 @@ extern struct list_head atm_devs;
extern
struct
mutex
atm_dev_mutex
;
extern
struct
mutex
atm_dev_mutex
;
int
atm_getnames
(
void
__user
*
buf
,
int
__user
*
iobuf_len
);
int
atm_getnames
(
void
__user
*
buf
,
int
__user
*
iobuf_len
);
int
atm_dev_ioctl
(
unsigned
int
cmd
,
void
__user
*
arg
,
int
compat
);
int
atm_dev_ioctl
(
unsigned
int
cmd
,
void
__user
*
buf
,
int
__user
*
sioc_len
,
int
number
,
int
compat
);
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
...
...
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