From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (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 E36403DBD4E for ; Wed, 15 Jul 2026 08:54:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784105684; cv=none; b=lU2GntjK8OErED0Gfu6hSdOu2bAtIt6PJmUs8nHoihlA23jhlx08CJfS0yzlL/oBjY2Z7HwoKo0Obo7su79V+lZtyF/v0nsdHimqjpWtgllUbdpylBwQSH3UVF+S8vMv/SqxK5bc5uAan0Iqe0kf3jrBRYXjFItCAjGl9U4S+CM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784105684; c=relaxed/simple; bh=hEYRQSd8L24KsvxuNroVxdJqty75+npmHbQjtSRCciI=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=sTfVDCjc+iW01yLMKNJihGcvcw0nQPXoTppNpF+SFgIdBShTo4uNk/nRu/AicBnLSyUdNnDKeiFAyY3OBIEuI2tXFpWnaYrEfCuFTKhnqWPuKq1hF91ynadLJOUtjlWoKcxAa28icJ1EW2YbXKWk1ym0RxtON4hkKj2tPj+oSn8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SgGL/LHN; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SgGL/LHN" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-84a4d8fd6ecso1822966b3a.1 for ; Wed, 15 Jul 2026 01:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784105681; x=1784710481; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:from:to :cc:subject:date:message-id:reply-to:content-type; bh=hEYRQSd8L24KsvxuNroVxdJqty75+npmHbQjtSRCciI=; b=SgGL/LHNYYqQEwqHHCqXbG/Cy4yxAKMTttPUbQ0IV8DJh/nIP5R1mezWVWAqDgX4pT 0nWx5vquDD0SMfn42uwkx6a3uxgjDgykmX0F6apPO0eovwnuvHWGtEYhYLyH3Jte+Eqx 2lb6ZFVPlzxU8ofmk4pshBM4gh+U8c0o51qnxtVH8Q5uAFpALSvgUC10LPDHumTuMNr5 B+YmftYimRJnEcXL5GlcGckbRNXXbMxcMK8Koe5ZsaeeWD3By2jueb05whJlPMaJd968 Hh9yitOS7JfsVZIFKbaKCs/V0qg33x1r8GslfTAuW3LUVOjJMW+Pec6Jj6FKxmHckKH5 ILqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784105681; x=1784710481; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=hEYRQSd8L24KsvxuNroVxdJqty75+npmHbQjtSRCciI=; b=T/SwcOUPJsvamwISmOW73tLla8HeLkUtKcnJi3wnrs7axTqYAxVq2FPJ+s+ThvxQUm BuxBSDyMOWRms/JY1ZPXdfsGoWY20YT+DIuZJ0RDrffu5x8VbR4kFeVgdz/yGcxR4RZF BAU20jePVy6+k4eq7mncwsWDgU37rLypLs0+VTEUhYfZTEsXWmrmNqRhYAyZ7mjeafix uLQxM/EN8c85Gq4YofOmdiuwQcgHK6MhZBBVcm+f/vMs3xF2gSAZq45EZE8RmHxr4hp8 riNVDf8wkCDX9URenXQiXZYcHR3XPscVwGQfWM4uVe5wdIbM5pRMJ0V4eEBIR31BOA6A YO8w== X-Forwarded-Encrypted: i=1; AHgh+RrwNx1bz/lAY4xipEEFGJkkeqN0o0mbkoXmuLE8H/dAgniFSydMFchwSRHkoDfB9VvgQX25a5/yHbcvqG6UHfw=@vger.kernel.org X-Gm-Message-State: AOJu0Yx42JEaPte63bUGg/N9Ox/Bb7XxTakJ5y88vQA24A8tPmxYr9vx XorTRgidTpEEU7aP3OBJbjX1prC3ZXIb3nm3uSNU795bPYreWzfuPiF0 X-Gm-Gg: AfdE7cmMoIIYYkXPwQPwuO5yg9ZTndiB/8ecOIuwcaQiuZ4zIT+4bQqxd3ApcK+CZSk GepeN25KVfiWctVaiqDOsRK3ZOvxxtf3qYbgkiQHrLmTWq44GGhHx9xDE+qF5B9JcJD/JnRW7di DPyU6vH8b4W5n0O99sH+r3S4ALGU/qfXVE+OHECKWxWHXaj66gsixqQbF6vtc3HzIX5fmFS4aAU +Vkoza8+JcRRb3QGnD0WBQOjcpeBOEuJ3c7YARcXx0Z2eEY4HIHGMF50Lz2+u38w/mrpo1frlpS z1Y/zOuE0jOe2imt7FLZ36+GIOGg4fBxJbzr7XgdGyjOVZLtEwMSio8Z/Dl07+/5VYTv3RP9bxG I/2ESB10QiSbGQv9xNurWIOdrHBy4myYqnZg+eGwRan/R1yt/8A9PkLT/8n/puP5aAP+6n/1dmM kNFmW1lJf9QRDLrOUamaj0znTuPtKXFkDab15IRI3y X-Received: by 2002:a05:6a00:368d:b0:848:56ff:6ced with SMTP id d2e1a72fcca58-84a6723d613mr1883067b3a.8.1784105680638; Wed, 15 Jul 2026 01:54:40 -0700 (PDT) Received: from [192.168.0.13] ([38.34.87.7]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84a4f6bebcesm2787462b3a.32.2026.07.15.01.54.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 01:54:40 -0700 (PDT) Message-ID: <488c235db713648bb2f5c90e4389c96a97ebcdde.camel@gmail.com> Subject: Re: [PATCH bpf v5 2/2] selftests/bpf: Cover negative buffer pointer offsets From: Eduard Zingerman To: sun jian , Shung-Hsi Yu Cc: bpf@vger.kernel.org, Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Emil Tsalapatis , Jiri Olsa , John Fastabend , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Shuah Khan , Song Liu , Yonghong Song , Matt Mullins , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, stable@vger.kernel.org Date: Wed, 15 Jul 2026 01:54:37 -0700 In-Reply-To: References: <20260714093846.18159-1-sun.jian.kdev@gmail.com> <20260714093846.18159-3-sun.jian.kdev@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2-10 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2026-07-15 at 13:26 +0800, sun jian wrote: [...] > > Anyway, still recommend adding a regression test that test access to on= e > > byte before the start of writable context. > >=20 >=20 > The new tracepoint_writable_reject_negative_const_offset verifier case > already covers an access before the start of the writable context: >=20 > =C2=A0=C2=A0=C2=A0 r6 =3D *(u64 *)(r1 + 0); > =C2=A0=C2=A0=C2=A0 r6 +=3D -8; > =C2=A0=C2=A0=C2=A0 r0 =3D *(u64 *)(r6 + 0); >=20 > Its effective access range is [-8, 0), so it is rejected at load time. > This is the direct regression test for the negative-start case. The existing test seem to be sufficient, why would it matter is at offset -8 or -1 given that the read is appropriately sized? The added test in tools/testing/selftests/bpf/progs/verifier_raw_tp_writabl= e.c is redundant given the changes in raw_tp_writable_reject_bad_access.c but I was going to apply anyway.