From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD9E026F299 for ; Mon, 17 Nov 2025 06:06:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763359600; cv=none; b=oMeUI+BZpmHQ9uv2qAh5KhQIg7cl11d0Sjo3CAR4Y5huDfvh+hYrYv275Yi8I7oG84Tc3Z5x1QIvjJczTzXBq2GE3G1PEY2SuRIL+me1iLnKMa74af1vHuooL11Ty5scMC9yTir/6G6xJMcJekFMhMyCVTIgfD0iKI1sGriQC7s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763359600; c=relaxed/simple; bh=fiL6oqMyBG2rjlnTIB3myv/nS2l10i3Q3vtmAqGo4I0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lhKTP2APeAYcZYcutgEbGnl7jj2i8cIyNlYt2a2wO3ZLZXSqCP0z0Saew5QJtxBZXrJ383n0IxzBBsfjBcL7t6RxgY3U/lPJayYxqZBSMtGl24TWkUHqT9lR5U5a1UIw8SpsKDj7jGIFpQTDb9lQqlIZxxl7ILEpJhaS0VHzUNQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=c2+SBHFc; arc=none smtp.client-ip=91.218.175.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="c2+SBHFc" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1763359596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C33sRpdbc0u4EVy33VHpB+KZaZ9PvousdUVbPNgqaks=; b=c2+SBHFc73U9z2RKaDR14wa6F/jFsbSykJ5zrmH3uHvUjbgg2w4WF6uWGILRVGXXUeKNaw UZzGgGWXPXMsj9Ce8vINFmI3MAp5GUc9nM77LGp7pDmJtDQFVrAInV51Kr/py/KG9c5AlH 20rpXwUZVDA+R9Eo63AtGhuUr41RCvc= Date: Sun, 16 Nov 2025 22:06:29 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH] bpf: Plug a potential exclusive map memory leak Content-Language: en-GB To: Edward Adam Davis , syzbot+cf08c551fecea9fd1320@syzkaller.appspotmail.com Cc: andrii@kernel.org, ast@kernel.org, bpf@vger.kernel.org, daniel@iogearbox.net, eddyz87@gmail.com, haoluo@google.com, john.fastabend@gmail.com, jolsa@kernel.org, kpsingh@kernel.org, linux-kernel@vger.kernel.org, martin.lau@linux.dev, sdf@fomichev.me, song@kernel.org, syzkaller-bugs@googlegroups.com References: <6919bd8f.a70a0220.3124cb.007d.GAE@google.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yonghong Song In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 11/16/25 6:58 AM, Edward Adam Davis wrote: > When excl_prog_hash is 0 and excl_prog_hash_size is non-zero, the map also > needs to be freed. Otherwise, the map memory will not be reclaimed, just > like the memory leak problem reported by syzbot [1]. > > syzbot reported: > BUG: memory leak > backtrace (crc 7b9fb9b4): > map_create+0x322/0x11e0 kernel/bpf/syscall.c:1512 > __sys_bpf+0x3556/0x3610 kernel/bpf/syscall.c:6131 > > Fixes: baefdbdf6812 ("bpf: Implement exclusive map creation") > Reported-by: syzbot+cf08c551fecea9fd1320@syzkaller.appspotmail.com > Closes: https://syzkaller.appspot.com/bug?extid=cf08c551fecea9fd1320 > Tested-by: syzbot+cf08c551fecea9fd1320@syzkaller.appspotmail.com > Signed-off-by: Edward Adam Davis Acked-by: Yonghong Song