From: Alexei Starovoitov Date: Wed, 15 Feb 2023 23:40:06 +0000 (-0800) Subject: Merge branch 'Use __GFP_ZERO in bpf memory allocator' X-Git-Tag: v6.6.17~5509^2~13^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3538a0fbbd81bc131afe48b4cf02895735944359;p=platform%2Fkernel%2Flinux-rpi.git Merge branch 'Use __GFP_ZERO in bpf memory allocator' Hou Tao says: ==================== From: Hou Tao Hi, The patchset tries to fix the hard-up problem found when checking how htab handles element reuse in bpf memory allocator. The immediate reuse of freed elements will reinitialize special fields (e.g., bpf_spin_lock) in htab map value and it may corrupt lookup procedure with BFP_F_LOCK flag which acquires bpf-spin-lock during value copying, and lead to hard-lock as shown in patch #2. Patch #1 fixes it by using __GFP_ZERO when allocating the object from slab and the behavior is similar with the preallocated hash-table case. Please see individual patches for more details. And comments are always welcome. Regards, Change Log: v1: * Use __GFP_ZERO instead of ctor to avoid retpoline overhead (from Alexei) * Add comments for check_and_init_map_value() (from Alexei) * split __GFP_ZERO patches out of the original patchset to unblock the development work of others. RFC: https://lore.kernel.org/bpf/20221230041151.1231169-1-houtao@huaweicloud.com ==================== Signed-off-by: Alexei Starovoitov --- 3538a0fbbd81bc131afe48b4cf02895735944359