Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95390
b: refs/heads/master
c: be666e0
h: refs/heads/master
v: v3
  • Loading branch information
David L Stevens authored and David S. Miller committed Apr 29, 2008
1 parent fd0cde4 commit 5206ff6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2ad17defd596ca7e8ba782d5fc6950ee0e99513c
refs/heads/master: be666e0a1345ed80f29cb30c73da0ec2ea5c5863
11 changes: 7 additions & 4 deletions trunk/net/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,9 @@ struct compat_group_filter {
__attribute__ ((aligned(4)));
} __attribute__ ((packed));

#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, int optlen,
Expand Down Expand Up @@ -582,7 +585,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname,
case MCAST_UNBLOCK_SOURCE:
{
struct compat_group_source_req __user *gsr32 = (void *)optval;
struct group_source_req *kgsr = compat_alloc_user_space(
struct group_source_req __user *kgsr = compat_alloc_user_space(
sizeof(struct group_source_req));
u32 interface;

Expand All @@ -603,10 +606,10 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname,
case MCAST_MSFILTER:
{
struct compat_group_filter __user *gf32 = (void *)optval;
struct group_filter *kgf;
struct group_filter __user *kgf;
u32 interface, fmode, numsrc;

if (!access_ok(VERIFY_READ, gf32, sizeof(*gf32)) ||
if (!access_ok(VERIFY_READ, gf32, __COMPAT_GF0_SIZE) ||
__get_user(interface, &gf32->gf_interface) ||
__get_user(fmode, &gf32->gf_fmode) ||
__get_user(numsrc, &gf32->gf_numsrc))
Expand All @@ -622,7 +625,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname,
__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 && copy_in_user(kgf->gf_slist, gf32->gf_slist,
numsrc * sizeof(kgf->gf_slist[0]))))
return -EFAULT;
koptval = (char __user *)kgf;
Expand Down

0 comments on commit 5206ff6

Please sign in to comment.