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 C7A7E3DA5C3 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-84a652535dcso370118b3a.3 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=Uw/bG4cD804uLYcnMBLziDfeCXvFotIJj4+iIf3XnUhhadH16ekZrbeBNvMimp2McL QZE40IA0b2mH8x7+kN/9p41C7mVqi0ioZQa0/I6yLXMipTscqwkg+kGf2fjQeaT4IKdU YVXIRFwy5IWKgOYnGDHvx8SeY4sUkEM575wwvsAV9yEF1CPUlDpN32c+H8hwQMKkZG3O iSm9jCgaOhYMeLvSgWy3Xy/mEYah40jCASXzHcmd7kPmuEtZfcwqk5/6wZkMlSeNZhl0 UdTzixzNydO0MmiuiztcH87EWiwzONM7jNRLFybsE/eXlHemPyWqCwaxZiGeXPF2fRpJ w+fA== X-Forwarded-Encrypted: i=1; AHgh+RpwBrKL44TjF48YvCOEtUiPIMVF0cB2QUo2TSviX913qmcTlYRchFoTUmKundwfbB/sGp12frJPiSTn+zk=@vger.kernel.org X-Gm-Message-State: AOJu0YzoITex+s7u19ouWUBOK4TGgkwkmiGKbu538jGw6cuBZpQmWOcx DVb9kLItUlTcI70sI4YiAhezR3uFyy5jvSSTSUzpQgDqm/jt6CeiikZe X-Gm-Gg: AfdE7cl+t56XPJzwiqmfin6+wY4Gm/ThrfJLt4tY7z+1DHIdqgegRnria+/mtdDjzwW XtTpxNLu0ThpI484iQHHG04u9mVZyATyKPWyN6iyKcTQ4VZIJqewVRw5ontcF/eIWeSduojtu9O Ycp+H+q6krqU/rRfGkBAI+v/CyoQweyFottS7DBm2m9H2zSHQFZWLoHTESfpD28C6L3tWUPrRz3 DdnUo4ZI2CGlVF1rDatdpx1/p32E7eglezrCtwwqYd/SfDrtpf9AL5mU6lMaM7u8s/5qQ5n6dfe CsXuqU6Zf12viAiYPoovJbDe0JoStWHda6Zkc7vcKu5NE4HAaTkSiysEzZkiHd6gxZVoYBlijqT aOnRE+OB3m2emgCJ0G8llI5byJ+hCuJ6rqMS/rXpM2zKOsEb5RwhzdJ+DNpK3OxagDnT3Q2pNDY s/8XOiOHeIFeYXejK+q8FxLvd7WrEE5ngYQar8l70O 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-kernel@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.