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
cfd024d7
Commit
cfd024d7
authored
Dec 07, 2004
by
David S. Miller
Committed by
Linus Torvalds
Dec 07, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: CMSG compat code needs signedness fixes too.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
620512af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
net/compat.c
net/compat.c
+7
-5
No files found.
net/compat.c
View file @
cfd024d7
...
...
@@ -124,6 +124,12 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,
(struct compat_cmsghdr __user *)((msg)->msg_control) : \
(struct compat_cmsghdr __user *)NULL)
#define CMSG_COMPAT_OK(ucmlen, ucmsg, mhdr) \
((ucmlen) >= sizeof(struct cmsghdr) && \
(ucmlen) <= (unsigned long) \
((mhdr)->msg_controllen - \
((char *)(ucmsg) - (char *)(mhdr)->msg_control)))
static
inline
struct
compat_cmsghdr
__user
*
cmsg_compat_nxthdr
(
struct
msghdr
*
msg
,
struct
compat_cmsghdr
__user
*
cmsg
,
int
cmsg_len
)
{
...
...
@@ -154,11 +160,7 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg,
return
-
EFAULT
;
/* Catch bogons. */
if
(
CMSG_COMPAT_ALIGN
(
ucmlen
)
<
CMSG_COMPAT_ALIGN
(
sizeof
(
struct
compat_cmsghdr
)))
return
-
EINVAL
;
if
((
unsigned
long
)(((
char
__user
*
)
ucmsg
-
(
char
__user
*
)
kmsg
->
msg_control
)
+
ucmlen
)
>
kmsg
->
msg_controllen
)
if
(
!
CMSG_COMPAT_OK
(
ucmlen
,
ucmsg
,
kmsg
))
return
-
EINVAL
;
tmp
=
((
ucmlen
-
CMSG_COMPAT_ALIGN
(
sizeof
(
*
ucmsg
)))
+
...
...
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