OSDN Git Service

bpf: fix memory leak in bpf_lwt_xmit_reroute
authorPeter Oskolkov <posk@google.com>
Thu, 14 Feb 2019 18:39:31 +0000 (10:39 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 14 Feb 2019 23:10:06 +0000 (15:10 -0800)
commitfb405883c189dd30f2fab2b3e2c954f34f000ac3
tree8fad4f225683a15d18682bd2e34adb3dd10b6b3c
parent87486b23f8aa7cf55c2df4a927691c5e8540c813
bpf: fix memory leak in bpf_lwt_xmit_reroute

On error the skb should be freed. Tested with diff/steps
provided by David Ahern.

v2: surface routing errors to the user instead of a generic EINVAL,
    as suggested by David Ahern.

Reported-by: David Ahern <dsahern@gmail.com>
Fixes: 3bd0b15281af ("bpf: add handling of BPF_LWT_REROUTE to lwt_bpf.c")
Signed-off-by: Peter Oskolkov <posk@google.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
net/core/lwt_bpf.c