From: Daniel Borkmann Date: Thu, 11 Sep 2014 09:36:48 +0000 (+0100) Subject: net: bpf: arm64: fix module memory leak when JIT image build fails X-Git-Tag: fixes-for-v3.18-merge-window~21^2~17 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60ef0494f197d4705b17132ee7d496283b5604b3;p=pandora-kernel.git net: bpf: arm64: fix module memory leak when JIT image build fails On ARM64, when the BPF JIT compiler fills the JIT image body with opcodes during translation of eBPF into ARM64 opcodes, we may fail for several reasons during that phase: one being that we jump to the notyet label for not yet supported eBPF instructions such as BPF_ST. In that case we only free offsets, but not the actual allocated target image where opcodes are being stored. Fix it by calling module_free() on dismantle time in case of errors. Signed-off-by: Daniel Borkmann Acked-by: Zi Shen Lim Acked-by: Will Deacon Cc: Alexei Starovoitov Signed-off-by: Catalin Marinas --- Reading git-diff-tree failed