From: Alexei Starovoitov <ast@plumgrid.com>
To: Eric Dumazet <erdnetdev@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
James Morris <jmorris@namei.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Patrick McHardy <kaber@trash.net>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
Daniel Borkmann <dborkman@redhat.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Xi Wang <xi.wang@gmail.com>,
x86@kernel.org, Eric Dumazet <edumazet@google.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 net-next] fix unsafe set_memory_rw from softirq
Date: Thu, 3 Oct 2013 16:10:58 -0700 [thread overview]
Message-ID: <CAMEtUuz0bASPsAAVO_m4TZh24LLWZnb6SK6BrnOvOR7_mezc7Q@mail.gmail.com> (raw)
In-Reply-To: <1380841333.19002.259.camel@edumazet-glaptop.roam.corp.google.com>
On Thu, Oct 3, 2013 at 4:02 PM, Eric Dumazet <erdnetdev@gmail.com> 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)
>> struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu);
>>
>> bpf_jit_free(fp);
>> +#if !defined(CONFIG_X86_64) /* x86_64 has a deferred free */
>> kfree(fp);
>> +#endif
>
> Sorry this is not very nice.
>
> Make bpf_jit_free(fp) a bool ? true : caller must free, false : caller
> must not free ?
>
> if (bpf_jit_free(fp))
> kfree(fp);
>
> Or move the kfree() in bpf_jit_free()
I think it's cleaner too, just didn't want to touch all architectures.
Will do then.
next prev parent reply other threads:[~2013-10-03 23:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-03 22:47 [PATCH v2 net-next] fix unsafe set_memory_rw from softirq Alexei Starovoitov
2013-10-03 23:02 ` Eric Dumazet
2013-10-03 23:10 ` Alexei Starovoitov [this message]
2013-10-03 23:07 ` Eric Dumazet
2013-10-03 23:11 ` Alexei Starovoitov
2013-10-04 2:26 ` Alexei Starovoitov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMEtUuz0bASPsAAVO_m4TZh24LLWZnb6SK6BrnOvOR7_mezc7Q@mail.gmail.com \
--to=ast@plumgrid.com \
--cc=davem@davemloft.net \
--cc=dborkman@redhat.com \
--cc=edumazet@google.com \
--cc=erdnetdev@gmail.com \
--cc=heiko.carstens@de.ibm.com \
--cc=hpa@zytor.com \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xi.wang@gmail.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).