Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 377009
b: refs/heads/master
c: ed13998
h: refs/heads/master
i:
  377007: 8395ea5
v: v3
  • Loading branch information
Nicolas Dichtel authored and David S. Miller committed Jun 11, 2013
1 parent 47b6df8 commit 5ea06fa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 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: 92bb73ea2c434618a68a58a2f3a5c3fd0b660d18
refs/heads/master: ed13998c319b050fc9abdb73915859dfdbe1fb38
1 change: 1 addition & 0 deletions trunk/include/linux/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
extern int sk_detach_filter(struct sock *sk);
extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
extern int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, unsigned len);
extern void sk_decode_filter(struct sock_filter *filt, struct sock_filter *to);

#ifdef CONFIG_BPF_JIT
#include <stdarg.h>
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 7 additions & 2 deletions trunk/net/core/sock_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5ea06fa

Please sign in to comment.