From: Eric Dumazet <eric.dumazet@gmail.com>
To: Alexei Starovoitov <ast@plumgrid.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, 03 Oct 2013 16:07:46 -0700 [thread overview]
Message-ID: <1380841666.19002.262.camel@edumazet-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <1380840466-3822-1-git-send-email-ast@plumgrid.com>
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) * fprog->len;
> + unsigned int fsize = max(sizeof(struct sock_filter) * fprog->len,
> + sizeof(struct work_struct));
> int err;
>
> if (sock_flag(sk, SOCK_FILTER_LOCKED))
Thats broken, as we might copy more data from user than expected,
and eventually trigger EFAULT :
if (copy_from_user(fp->insns, fprog->filter, fsize)) {
next prev parent reply other threads:[~2013-10-03 23:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-03 22:47 Alexei Starovoitov
2013-10-03 23:02 ` Eric Dumazet
2013-10-03 23:10 ` Alexei Starovoitov
2013-10-03 23:07 ` Eric Dumazet [this message]
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=1380841666.19002.262.camel@edumazet-glaptop.roam.corp.google.com \
--to=eric.dumazet@gmail.com \
--cc=ast@plumgrid.com \
--cc=davem@davemloft.net \
--cc=dborkman@redhat.com \
--cc=edumazet@google.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
all inboxes | Powered by JetHome®