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

From: Daniel Borkmann
Date: Sat Sep 13 2014 - 05:13:13 EST


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 vmalloc()ed memory, and leak the internal bpf_work_struct.

Signed-off-by: Sasha Levin <sasha.levin@xxxxxxxxxx>

[ This patch is for net-next. ]

Acked-by: Daniel Borkmann <dborkman@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/