Re: [PATCH] net: bpf: correctly handle errors in sk_attach_filter()

2014-09-13 Thread David Miller
From: Sasha Levin Date: Sat, 13 Sep 2014 00:06:30 -0400 > Commit "net: bpf: make eBPF interpreter images read-only" has changed bpf_prog > to be vmalloc()ed but never handled some of the errors paths of the old code. > > On error within sk_attach_filter (which userspace can easily trigger),

Re: [PATCH] net: bpf: correctly handle errors in sk_attach_filter()

2014-09-13 Thread Hannes Frederic Sowa
On Sa, 2014-09-13 at 00:06 -0400, Sasha Levin wrote: > Commit "net: bpf: make eBPF interpreter images read-only" has changed bpf_prog > to be vmalloc()ed but never handled some of the errors paths of the old code. > > On error within sk_attach_filter (which userspace can easily trigger), we'd >

Re: [PATCH] net: bpf: correctly handle errors in sk_attach_filter()

2014-09-13 Thread Daniel Borkmann
On 09/13/2014 06:06 AM, Sasha Levin wrote: Commit "net: bpf: make eBPF interpreter images read-only" has changed bpf_prog to be vmalloc()ed but never handled some of the errors paths of the old code. On error within sk_attach_filter (which userspace can easily trigger), we'd kfree() the

Re: [PATCH] net: bpf: correctly handle errors in sk_attach_filter()

2014-09-13 Thread Daniel Borkmann
On 09/13/2014 06:06 AM, Sasha Levin wrote: Commit net: bpf: make eBPF interpreter images read-only has changed bpf_prog to be vmalloc()ed but never handled some of the errors paths of the old code. On error within sk_attach_filter (which userspace can easily trigger), we'd kfree() the

Re: [PATCH] net: bpf: correctly handle errors in sk_attach_filter()

2014-09-13 Thread Hannes Frederic Sowa
On Sa, 2014-09-13 at 00:06 -0400, Sasha Levin wrote: Commit net: bpf: make eBPF interpreter images read-only has changed bpf_prog to be vmalloc()ed but never handled some of the errors paths of the old code. On error within sk_attach_filter (which userspace can easily trigger), we'd kfree()

Re: [PATCH] net: bpf: correctly handle errors in sk_attach_filter()

2014-09-13 Thread David Miller
From: Sasha Levin sasha.le...@oracle.com Date: Sat, 13 Sep 2014 00:06:30 -0400 Commit net: bpf: make eBPF interpreter images read-only has changed bpf_prog to be vmalloc()ed but never handled some of the errors paths of the old code. On error within sk_attach_filter (which userspace can

[PATCH] net: bpf: correctly handle errors in sk_attach_filter()

2014-09-12 Thread Sasha Levin
Commit "net: bpf: make eBPF interpreter images read-only" has changed bpf_prog to be vmalloc()ed but never handled some of the errors paths of the old code. On error within sk_attach_filter (which userspace can easily trigger), we'd kfree() the vmalloc()ed memory, and leak the internal

[PATCH] net: bpf: correctly handle errors in sk_attach_filter()

2014-09-12 Thread Sasha Levin
Commit net: bpf: make eBPF interpreter images read-only has changed bpf_prog to be vmalloc()ed but never handled some of the errors paths of the old code. On error within sk_attach_filter (which userspace can easily trigger), we'd kfree() the vmalloc()ed memory, and leak the internal