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
bbced07d
Commit
bbced07d
authored
Apr 27, 2020
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get rid of compat_mc_setsockopt()
not used anymore Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
b212c322
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
94 deletions
+0
-94
include/net/compat.h
include/net/compat.h
+0
-4
net/compat.c
net/compat.c
+0
-90
No files found.
include/net/compat.h
View file @
bbced07d
...
...
@@ -67,10 +67,6 @@ int put_cmsg_compat(struct msghdr*, int, int, int, void *);
int
cmsghdr_from_user_compat_to_kern
(
struct
msghdr
*
,
struct
sock
*
,
unsigned
char
*
,
int
);
int
compat_mc_setsockopt
(
struct
sock
*
,
int
,
int
,
char
__user
*
,
unsigned
int
,
int
(
*
)(
struct
sock
*
,
int
,
int
,
char
__user
*
,
unsigned
int
));
struct
compat_group_req
{
__u32
gr_interface
;
struct
__kernel_sockaddr_storage
gr_group
...
...
net/compat.c
View file @
bbced07d
...
...
@@ -448,96 +448,6 @@ COMPAT_SYSCALL_DEFINE5(getsockopt, int, fd, int, level, int, optname,
return
__compat_sys_getsockopt
(
fd
,
level
,
optname
,
optval
,
optlen
);
}
#define __COMPAT_GF0_SIZE (sizeof(struct compat_group_filter) - \
sizeof(struct __kernel_sockaddr_storage))
int
compat_mc_setsockopt
(
struct
sock
*
sock
,
int
level
,
int
optname
,
char
__user
*
optval
,
unsigned
int
optlen
,
int
(
*
setsockopt
)(
struct
sock
*
,
int
,
int
,
char
__user
*
,
unsigned
int
))
{
char
__user
*
koptval
=
optval
;
int
koptlen
=
optlen
;
switch
(
optname
)
{
case
MCAST_JOIN_GROUP
:
case
MCAST_LEAVE_GROUP
:
{
struct
compat_group_req
__user
*
gr32
=
(
void
__user
*
)
optval
;
struct
group_req
__user
*
kgr
=
compat_alloc_user_space
(
sizeof
(
struct
group_req
));
u32
interface
;
if
(
!
access_ok
(
gr32
,
sizeof
(
*
gr32
))
||
!
access_ok
(
kgr
,
sizeof
(
struct
group_req
))
||
__get_user
(
interface
,
&
gr32
->
gr_interface
)
||
__put_user
(
interface
,
&
kgr
->
gr_interface
)
||
copy_in_user
(
&
kgr
->
gr_group
,
&
gr32
->
gr_group
,
sizeof
(
kgr
->
gr_group
)))
return
-
EFAULT
;
koptval
=
(
char
__user
*
)
kgr
;
koptlen
=
sizeof
(
struct
group_req
);
break
;
}
case
MCAST_JOIN_SOURCE_GROUP
:
case
MCAST_LEAVE_SOURCE_GROUP
:
case
MCAST_BLOCK_SOURCE
:
case
MCAST_UNBLOCK_SOURCE
:
{
struct
compat_group_source_req
__user
*
gsr32
=
(
void
__user
*
)
optval
;
struct
group_source_req
__user
*
kgsr
=
compat_alloc_user_space
(
sizeof
(
struct
group_source_req
));
u32
interface
;
if
(
!
access_ok
(
gsr32
,
sizeof
(
*
gsr32
))
||
!
access_ok
(
kgsr
,
sizeof
(
struct
group_source_req
))
||
__get_user
(
interface
,
&
gsr32
->
gsr_interface
)
||
__put_user
(
interface
,
&
kgsr
->
gsr_interface
)
||
copy_in_user
(
&
kgsr
->
gsr_group
,
&
gsr32
->
gsr_group
,
sizeof
(
kgsr
->
gsr_group
))
||
copy_in_user
(
&
kgsr
->
gsr_source
,
&
gsr32
->
gsr_source
,
sizeof
(
kgsr
->
gsr_source
)))
return
-
EFAULT
;
koptval
=
(
char
__user
*
)
kgsr
;
koptlen
=
sizeof
(
struct
group_source_req
);
break
;
}
case
MCAST_MSFILTER
:
{
struct
compat_group_filter
__user
*
gf32
=
(
void
__user
*
)
optval
;
struct
group_filter
__user
*
kgf
;
u32
interface
,
fmode
,
numsrc
;
if
(
!
access_ok
(
gf32
,
__COMPAT_GF0_SIZE
)
||
__get_user
(
interface
,
&
gf32
->
gf_interface
)
||
__get_user
(
fmode
,
&
gf32
->
gf_fmode
)
||
__get_user
(
numsrc
,
&
gf32
->
gf_numsrc
))
return
-
EFAULT
;
koptlen
=
optlen
+
sizeof
(
struct
group_filter
)
-
sizeof
(
struct
compat_group_filter
);
if
(
koptlen
<
GROUP_FILTER_SIZE
(
numsrc
))
return
-
EINVAL
;
kgf
=
compat_alloc_user_space
(
koptlen
);
if
(
!
access_ok
(
kgf
,
koptlen
)
||
__put_user
(
interface
,
&
kgf
->
gf_interface
)
||
__put_user
(
fmode
,
&
kgf
->
gf_fmode
)
||
__put_user
(
numsrc
,
&
kgf
->
gf_numsrc
)
||
copy_in_user
(
&
kgf
->
gf_group
,
&
gf32
->
gf_group
,
sizeof
(
kgf
->
gf_group
))
||
(
numsrc
&&
copy_in_user
(
kgf
->
gf_slist
,
gf32
->
gf_slist
,
numsrc
*
sizeof
(
kgf
->
gf_slist
[
0
]))))
return
-
EFAULT
;
koptval
=
(
char
__user
*
)
kgf
;
break
;
}
default:
break
;
}
return
setsockopt
(
sock
,
level
,
optname
,
koptval
,
koptlen
);
}
EXPORT_SYMBOL
(
compat_mc_setsockopt
);
/* Argument list sizes for compat_sys_socketcall */
#define AL(x) ((x) * sizeof(u32))
static
unsigned
char
nas
[
21
]
=
{
...
...
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