Florian Westphal <fw@xxxxxxxxx> wrote: > pipapo relies on kmalloc(0) returning ZERO_SIZE_PTR (i.e., not NULL > but pointer is invalid). > > Rework this to not call slab allocator when we'd request a 0-byte > allocation. > > While at it, also use GFP_KERNEL allocations here, this is only called > from control plane. For the record, Pablo points out this is incorrect, as "nft get element" holds rcu read lock and not the transaction mutex. Existing nftables shell tests trigger sleeping-while-atomic splat here. > - res_map = kmalloc_array(m->bsize_max, sizeof(*res_map), GFP_ATOMIC); > + res_map = kmalloc_array(m->bsize_max, sizeof(*res_map), GFP_KERNEL); I've applied the patch without the GFP_KERNEL replacement, no other changes, shell tests pass after this.