Re: [PATCH v2 net-next] fix unsafe set_memory_rw from softirq

2013-10-03 Thread Alexei Starovoitov
On Thu, Oct 3, 2013 at 4:11 PM, Alexei Starovoitov wrote: > On Thu, Oct 3, 2013 at 4:07 PM, Eric Dumazet wrote: >> On Thu, 2013-10-03 at 15:47 -0700, Alexei Starovoitov wrote: >> >>> @@ -722,7 +725,8 @@ EXPORT_SYMBOL_GPL(sk_unattached_filter_destroy); >>> int sk_attach_filter(struct sock_fprog *

Re: [PATCH v2 net-next] fix unsafe set_memory_rw from softirq

2013-10-03 Thread Alexei Starovoitov
On Thu, Oct 3, 2013 at 4:07 PM, Eric Dumazet wrote: > On Thu, 2013-10-03 at 15:47 -0700, Alexei Starovoitov wrote: > >> @@ -722,7 +725,8 @@ EXPORT_SYMBOL_GPL(sk_unattached_filter_destroy); >> int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) >> { >> struct sk_filter *fp, *old

Re: [PATCH v2 net-next] fix unsafe set_memory_rw from softirq

2013-10-03 Thread Alexei Starovoitov
On Thu, Oct 3, 2013 at 4:02 PM, Eric Dumazet wrote: > On Thu, 2013-10-03 at 15:47 -0700, Alexei Starovoitov wrote: >> on x86 system with net.core.bpf_jit_enable = 1 >> > >> --- a/net/core/filter.c >> +++ b/net/core/filter.c >> @@ -644,7 +644,9 @@ void sk_filter_release_rcu(struct rcu_head *rcu) >>

Re: [PATCH v2 net-next] fix unsafe set_memory_rw from softirq

2013-10-03 Thread Eric Dumazet
On Thu, 2013-10-03 at 15:47 -0700, Alexei Starovoitov wrote: > @@ -722,7 +725,8 @@ EXPORT_SYMBOL_GPL(sk_unattached_filter_destroy); > int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) > { > struct sk_filter *fp, *old_fp; > - unsigned int fsize = sizeof(struct sock_filter)

Re: [PATCH v2 net-next] fix unsafe set_memory_rw from softirq

2013-10-03 Thread Eric Dumazet
On Thu, 2013-10-03 at 15:47 -0700, Alexei Starovoitov wrote: > on x86 system with net.core.bpf_jit_enable = 1 > > --- a/net/core/filter.c > +++ b/net/core/filter.c > @@ -644,7 +644,9 @@ void sk_filter_release_rcu(struct rcu_head *rcu) > struct sk_filter *fp = container_of(rcu, struct sk_fil

[PATCH v2 net-next] fix unsafe set_memory_rw from softirq

2013-10-03 Thread Alexei Starovoitov
on x86 system with net.core.bpf_jit_enable = 1 sudo tcpdump -i eth1 'tcp port 22' causes the warning: [ 56.766097] Possible unsafe locking scenario: [ 56.766097] [ 56.780146]CPU0 [ 56.786807] [ 56.793188] lock(&(&vb->lock)->rlock); [ 56.799593] [ 56.805889]