diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-17 11:54:25 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-17 11:54:25 -0700 |
commit | 0e496b8e84410c96d1ffc86f0b37b0328a4234da (patch) | |
tree | d8a2aeeaee03eb4f305ba4dc5ab9395c4ee31321 /net/core | |
parent | 214da6728acac285cac0e8e9b6c4c13838b8e1b0 (diff) | |
parent | 7d132055814ef17a6c7b69f342244c410a5e000f (diff) |
Merge 3.10-rc6 into char-misc-next
We want the fixes in here.
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/filter.c | 2 | ||||
-rw-r--r-- | net/core/sock_diag.c | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/net/core/filter.c b/net/core/filter.c index dad2a178f9f..6438f29ff26 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -778,7 +778,7 @@ int sk_detach_filter(struct sock *sk) } EXPORT_SYMBOL_GPL(sk_detach_filter); -static void sk_decode_filter(struct sock_filter *filt, struct sock_filter *to) +void sk_decode_filter(struct sock_filter *filt, struct sock_filter *to) { static const u16 decodes[] = { [BPF_S_ALU_ADD_K] = BPF_ALU|BPF_ADD|BPF_K, diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c index d5bef0b0f63..a0e9cf6379d 100644 --- a/net/core/sock_diag.c +++ b/net/core/sock_diag.c @@ -73,8 +73,13 @@ int sock_diag_put_filterinfo(struct user_namespace *user_ns, struct sock *sk, goto out; } - if (filter) - memcpy(nla_data(attr), filter->insns, len); + if (filter) { + struct sock_filter *fb = (struct sock_filter *)nla_data(attr); + int i; + + for (i = 0; i < filter->len; i++, fb++) + sk_decode_filter(&filter->insns[i], fb); + } out: rcu_read_unlock(); |