summaryrefslogtreecommitdiff
path: root/net/bridge/netfilter/nft_meta_bridge.c
diff options
context:
space:
mode:
authorWenwen Wang <wenwen@cs.uga.edu>2019-07-20 15:22:45 +0300
committerPablo Neira Ayuso <pablo@netfilter.org>2019-07-21 22:00:15 +0300
commit15a78ba1844a8e052c1226f930133de4cef4e7ad (patch)
tree7ef9cb562bad41a368b7ae9b8052e00ada3c5a39 /net/bridge/netfilter/nft_meta_bridge.c
parent0cea0e1148fe134a4a3aaf0b1496f09241fb943a (diff)
downloadlinux-15a78ba1844a8e052c1226f930133de4cef4e7ad.tar.xz
netfilter: ebtables: fix a memory leak bug in compat
In compat_do_replace(), a temporary buffer is allocated through vmalloc() to hold entries copied from the user space. The buffer address is firstly saved to 'newinfo->entries', and later on assigned to 'entries_tmp'. Then the entries in this temporary buffer is copied to the internal kernel structure through compat_copy_entries(). If this copy process fails, compat_do_replace() should be terminated. However, the allocated temporary buffer is not freed on this path, leading to a memory leak. To fix the bug, free the buffer before returning from compat_do_replace(). Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu> Reviewed-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/bridge/netfilter/nft_meta_bridge.c')
0 files changed, 0 insertions, 0 deletions