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
b467c8e7
Commit
b467c8e7
authored
Dec 01, 2002
by
Sridhar Samudrala
Committed by
Sridhar Samudrala
Dec 01, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SCTP] Fix for memcpy() in sctp_sendmsg() that can copy too much.
parent
f77e008b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
net/sctp/socket.c
net/sctp/socket.c
+9
-8
No files found.
net/sctp/socket.c
View file @
b467c8e7
...
...
@@ -711,7 +711,7 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
SCTP_STATIC
int
sctp_msghdr_parse
(
const
struct
msghdr
*
,
sctp_cmsgs_t
*
);
SCTP_STATIC
int
sctp_sendmsg
(
struct
kiocb
*
iocb
,
struct
sock
*
sk
,
struct
msghdr
*
msg
,
int
size
)
struct
msghdr
*
msg
,
int
msg_len
)
{
sctp_opt_t
*
sp
;
sctp_endpoint_t
*
ep
;
...
...
@@ -726,13 +726,12 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
sctp_assoc_t
associd
=
NULL
;
sctp_cmsgs_t
cmsgs
=
{
0
};
int
err
;
size_t
msg_len
;
sctp_scope_t
scope
;
long
timeo
;
__u16
sinfo_flags
=
0
;
SCTP_DEBUG_PRINTK
(
"sctp_sendmsg(sk: %p, msg: %p,
"
"size: %d)
\n
"
,
sk
,
msg
,
size
);
SCTP_DEBUG_PRINTK
(
"sctp_sendmsg(sk: %p, msg: %p,
msg_len: %d)
\n
"
,
sk
,
msg
,
msg_len
);
err
=
0
;
sp
=
sctp_sk
(
sk
);
...
...
@@ -754,12 +753,16 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
* For a peeled-off socket, msg_name is ignored.
*/
if
((
SCTP_SOCKET_UDP_HIGH_BANDWIDTH
!=
sp
->
type
)
&&
msg
->
msg_name
)
{
int
msg_namelen
=
msg
->
msg_namelen
;
err
=
sctp_verify_addr
(
sk
,
(
union
sctp_addr
*
)
msg
->
msg_name
,
msg
->
msg
_namelen
);
msg_namelen
);
if
(
err
)
return
err
;
memcpy
(
&
to
,
msg
->
msg_name
,
msg
->
msg_namelen
);
if
(
msg_namelen
>
sizeof
(
to
))
msg_namelen
=
sizeof
(
to
);
memcpy
(
&
to
,
msg
->
msg_name
,
msg_namelen
);
SCTP_DEBUG_PRINTK
(
"Just memcpy'd. msg_name is "
"0x%x:%u.
\n
"
,
to
.
v4
.
sin_addr
.
s_addr
,
to
.
v4
.
sin_port
);
...
...
@@ -768,8 +771,6 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
msg_name
=
msg
->
msg_name
;
}
msg_len
=
get_user_iov_size
(
msg
->
msg_iov
,
msg
->
msg_iovlen
);
sinfo
=
cmsgs
.
info
;
sinit
=
cmsgs
.
init
;
...
...
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