From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796190211; b=UL3bKy0VVPfVrRrqn/XVW0jSGKnuH8C/ykZhiq0r6cMYblGcOTpW9+4nwWHg9zY5BXt7 hm4iP9/IlrBOu8cq2oe4LRlEcw13wETHLsMhuXshAC+CdcYBRTWUgu2xaM0uJC7RQ06j0 h8rM4KvG8B5vbSSqLdBcDfuLc+NvpeMjw5om5KujvYiGUUJwEOQymK11r0cSt8FJNTNva kBxmiL7gNwuFaAt16je8gm+2UKM0c8R2l3cF4Gm8T9HWTvMij17B8RMfnRJ9l9fH7CdO1 I2n8jEQHUYZfbo2Mb+NbHaSM8GZfJE3iFWqkfVKzmsw9sdoi1kNlAhGX+bAp+QGMP+w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796190211; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=tmRS6c4MLwNTMZHvTjnjmtJ4lj+6nYLwS7Ivv3/UkIs=; b=piwftxEr9j+WRq7NkFCX9iUIrTB2qierzr/g/KyfeQ0+d22Bsv2QAwJF9pS2QGbK56Kd R5D3mkcqjl2seClXU0bD/0ppSS+QuBnqw5ym2rFxdHWXuj2j7ha02/4LIIZTTPqW40XOt /H0rVtwBUmSdF5tDbp9qZOHlDvIY9TVnOS+c93CAr4FXgbqz7gyrHGwNJ/HuVWhutzIFr T5vsbL9Qbmzx1ZGMr5efWPDLWY+kiYJZKDW0bDE57LxMQ71yQ9PuHz/F8tOR4UBStLWwK xm0a2xP9KGKEO22v0VVKu1P/chNcHiG7bT8oh1SYZ6KhiyP58hrLl7j0L7x27ibm4RQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nfL1c3Vl; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E03AA606A6A2 for ; Wed, 2 Dec 2026 05:43:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nfL1c3Vl Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DC011F00893; Wed, 2 Dec 2026 05:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796190210; bh=tmRS6c4MLwNTMZHvTjnjmtJ4lj+6nYLwS7Ivv3/UkIs=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=nfL1c3Vl0ORUbmJl+9wtN2HBqkvLHlCvcNlxi/POLIyfsQ3LboCPGixgmpLir3SNo RZKZ3XRIG5kCNmnxw7AdGJAEcmlHub+ojuuS+XylGB0xSGyT1pTro3nsxqS5oD2buu lCthTaGeJ42mOz93fWIyZE1OF46KW+PHc1EFPL9GMDrYNvm5V8e08icMO/f6nY4ELy Y+AqprsW9ShwIe2FHSTvNw7OaVSvpYKOoIFt48KE1ROOGnmWUub8g8GnaFuDRke2KP CNOcU6MdeWuOUDHoREnRmzwKvb7AgugcxKPbtweRieXm2oLSfGxkkOwnYA0k7hKQzC zac9G1M0c8zBQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] bpf: Bound the resizable hashtab batch buffers by max_entries Reply-To: sashiko-reviews@lists.linux.dev To: "Peng Hao" Cc: bpf@vger.kernel.org In-Reply-To: <20261202053720.92474-1-flyingpeng@tencent.com> References: <20261202053720.92474-1-flyingpeng@tencent.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 05:43:30 +0000 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] bpf: incorrect Fixes tag for __rhtab_map_lookup_and_delete_batch() -- commit 9770249174f01abb3a3d1236fe3c14f234ab367c Author: Peng Hao > bpf: Bound the resizable hashtab batch buffers by max_entries > > __rhtab_map_lookup_and_delete_batch() allocates the key, value and > element pointer buffers for attr->batch.count entries before it looks at > the map. count comes straight from userspace and is not limited by the > size of the map, so a lookup batch on a one-element map with a 4K value > and count =3D 65536 has the kernel allocate about 257 MB, and > count =3D 1048576 asks for about 4 GB and fails with -ENOMEM instead of > returning the element. > > A batch never returns more than max_entries elements, so clamp the > buffer size to that. The regular hash map sizes its buffers by bucket > size instead, so it doesn't have this problem. > > Fixes: 16b4d3e2fb24 ("bpf: Implement resizable hashmap basic functions") > Signed-off-by: Peng Hao [Severity: Low] __rhtab_map_lookup_and_delete_batch() was introduced in 818e00848227 ("bpf: Implement iteration ops for resizable hashtab") rather than 16b4d3e2fb24 ("bpf: Implement resizable hashmap basic functions"). Should the Fixes tag be updated to: Fixes: 818e00848227 ("bpf: Implement iteration ops for resizable hashtab") --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202053720.9247= 4-1-flyingpeng@tencent.com?part=3D1