From: Sasha Levin Date: Sat, 13 Sep 2014 04:06:30 +0000 (-0400) Subject: net: bpf: correctly handle errors in sk_attach_filter() X-Git-Tag: omap-for-v3.19/prcm-cleanup~78^2~61 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0d1379a19c3dde3c32be50164997d246241c1e4;p=pandora-kernel.git net: bpf: correctly handle errors in sk_attach_filter() 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 bpf_work_struct. Signed-off-by: Sasha Levin Acked-by: Daniel Borkmann Acked-by: Hannes Frederic Sowa Signed-off-by: David S. Miller --- Reading git-diff-tree failed