From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7284D330652 for ; Tue, 16 Dec 2025 17:25:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765905923; cv=none; b=froTogPEh56zabhw0pBgtuPpudUzqwIXxrG93YRP2hQb/tRk5nYr3XmUouSgOFCE43PaPHBu8rBdZCAc0Wh/+2bPx/yG6QjQXP6luIpYYdoCVHr8IeavYnBD+OfeNqJW3OImlqQ1QjUE6JIjnE9TB0XLS2vckqPbOzS1Bd0F8xc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765905923; c=relaxed/simple; bh=K3Wy8gVjTVOF56EMynBzdgOaChDCyS40WkQoQD2u8Q0=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=qlBu5T/bYPfMdlUZBm6kzEQJmWTspSDYGHDjE0I0QHEhblwBmOFzScnFHmK+gjRkJcJD5D44wgm7KQbbNTKYYbXl36PcDGE6xOdFikSgT0bkvIO3uqFkoW7yebxQ3ORrBKAChcTKa+zcCNRXASsrA/vp09YfOka3TCY9PBMIU80= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=etsalapatis.com; spf=pass smtp.mailfrom=etsalapatis.com; dkim=pass (2048-bit key) header.d=etsalapatis-com.20230601.gappssmtp.com header.i=@etsalapatis-com.20230601.gappssmtp.com header.b=jSYGcNR9; arc=none smtp.client-ip=209.85.160.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=etsalapatis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=etsalapatis.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=etsalapatis-com.20230601.gappssmtp.com header.i=@etsalapatis-com.20230601.gappssmtp.com header.b="jSYGcNR9" Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-4ee1879e6d9so57484921cf.1 for ; Tue, 16 Dec 2025 09:25:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=etsalapatis-com.20230601.gappssmtp.com; s=20230601; t=1765905920; x=1766510720; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=K3Wy8gVjTVOF56EMynBzdgOaChDCyS40WkQoQD2u8Q0=; b=jSYGcNR9NLxOr3cvl5K7PnoonAsji/UcR1f8OCHauw9MLGVVARRa+bIU2F6trpZpvN VDen6XJ+vJKi1qQX2fJr00GIaaydF/5Zni4osUlLWSd50S+TF7/lWY0u9YSJm+BiPzhP 3H5JEtgVPl39SnZchKv9nDFhT8R+jAjDelBrofVkoGWMyzjF0iqzPdfsP5Nbgakke2Ts OWJ16WPANH45vcyMqu/USdoPvJYRntk10Ij+TDKSJ3KbIhZ+zw1YHoZ+tvK0ARcu+DBs OYxprJU+WLLrMGkkTuTs+/beb2Pjk1TjhZWTfKNy9apaPcHeZw4Px+McJ6bvkii1dVWG R8lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765905920; x=1766510720; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=K3Wy8gVjTVOF56EMynBzdgOaChDCyS40WkQoQD2u8Q0=; b=GVDaEwNwKVUNWXkzJJQSvi1t+ywagAVpaisXRbwe41+q8Bc1WOBCb8AgKlPhhQ654r TQtHdm+SSp4kixQ0vYUf3HbfU707yicCU/wj1l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ac8:5908:0:b0:4ee:2459:3d6b with SMTP id d75a77b69052e-4f1d05af856mr236548231cf.49.1765905920093; Tue, 16 Dec 2025 09:25:20 -0800 (PST) Received: from localhost ([140.174.219.137]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4f345b4b894sm19859651cf.12.2025.12.16.09.25.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Dec 2025 09:25:19 -0800 (PST) Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 16 Dec 2025 12:25:18 -0500 Message-Id: Cc: , , , , , Subject: Re: [PATCH v3 2/5] bpf/verifier: do not limit maximum direct offset into arena map From: "Emil Tsalapatis" To: "Eduard Zingerman" , X-Mailer: aerc 0.20.1 References: <20251215161313.10120-1-emil@etsalapatis.com> <20251215161313.10120-3-emil@etsalapatis.com> <0720a98e6a73ee6298d73b2c64a08f47a4337007.camel@gmail.com> In-Reply-To: <0720a98e6a73ee6298d73b2c64a08f47a4337007.camel@gmail.com> On Mon Dec 15, 2025 at 3:19 PM EST, Eduard Zingerman wrote: > On Mon, 2025-12-15 at 11:13 -0500, Emil Tsalapatis wrote: >> The verifier currently limits direct offsets into a map to 512MiB >> to avoid overflow during pointer arithmetic. However, this prevents >> arena maps from using direct addressing instructions to access data >> at the end of > 512MiB arena maps. This is necessary when moving >> arena globals to the end of the arena instead of the front. >>=20 >> Refactor the verifier code to remove the offset calculation during >> direct value access calculations. This is possible because the only >> two map types that implement .map_direct_value_addr() are arrays and >> arenas, and they both do their own internal checks to ensure the >> offset is within bounds. > > Nit: instruction array map also implements it (bpf_insn_array.c). > >>=20 >> Signed-off-by: Emil Tsalapatis >> --- > > I double checked implementations for all 3 map types and confirm that > the above is correct. Also, I commented out the range checks in kernel > implementations (as in the attached patch), and no tests seem to fail. > Do we need to extend selftests? I forgot to address a couple selftest errors from this patch in this versio= n, but after fixing them for v4 and applying the attached patch I am getting a couple failures - direct map access tests #332, #334, #336, #337, #338, #34= 5. #332 (write test 7) is an unexpected load success, while the rest are about= a=20 mismatch in the error message. Maybe the test wasn't being marked as an=20 unexpected success because I hadn't fixed it up? > > Acked-by: Eduard Zingerman =20 I will omit the Acked-by tag in v4 because I changed the selftests - sorry = for the=20 after-the-fact changes. > [...]