Re: [PATCH net] bpf: fix map not being uncharged during map creation failure

2016-11-07 Thread David Miller
From: Daniel Borkmann Date: Fri, 4 Nov 2016 00:56:31 +0100 > 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 RLI

[PATCH net] bpf: fix map not being uncharged during map creation failure

2016-11-03 Thread Daniel Borkmann
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