aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-powernv.c
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2016-11-04 00:56:31 +0100
committerDavid S. Miller <davem@davemloft.net>2016-11-07 13:22:26 -0500
commit20b2b24f91f70e7d3f0918c077546cb21bd73a87 (patch)
treeecdffd693fa3fd2d368def47c1ea510330119265 /drivers/leds/leds-powernv.c
parentbpf: fix htab map destruction when extra reserve is in use (diff)
downloadlinux-dev-20b2b24f91f70e7d3f0918c077546cb21bd73a87.tar.xz
linux-dev-20b2b24f91f70e7d3f0918c077546cb21bd73a87.zip
bpf: fix map not being uncharged during map creation failure
In map_create(), we first find and create the map, then once that suceeded, we charge it to the user's RLIMIT_MEMLOCK, and then fetch a new anon fd through anon_inode_getfd(). The problem is, once the latter fails f.e. due to RLIMIT_NOFILE limit, then we only destruct the map via map->ops->map_free(), but without uncharging the previously locked memory first. That means that the user_struct allocation is leaked as well as the accounted RLIMIT_MEMLOCK memory not released. Make the label names in the fix consistent with bpf_prog_load(). Fixes: aaac3ba95e4c ("bpf: charge user for creation of BPF maps and programs") Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/leds/leds-powernv.c')
0 files changed, 0 insertions, 0 deletions