On Thu, Jun 11, 2020 at 5:09 PM Andrey Ignatov <rdna@xxxxxx> wrote: > > Add missed bpf_map_charge_init() in sock_hash_alloc() and > correspondingly bpf_map_charge_finish() on ENOMEM. > > It was found accidentally while working on unrelated selftest that > checks "map->memory.pages > 0" is true for all map types. > > Before: > # bpftool m l > ... > 3692: sockhash name m_sockhash flags 0x0 > key 4B value 4B max_entries 8 memlock 0B > > After: > # bpftool m l > ... > 84: sockmap name m_sockmap flags 0x0 > key 4B value 4B max_entries 8 memlock 4096B > > Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") > Signed-off-by: Andrey Ignatov <rdna@xxxxxx> That's a nasty one. Good catch. Applied.