From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 204C73BF684 for ; Sun, 16 Aug 2026 23:56:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786924604; cv=none; b=YcgqqubkQLSd5q5d7auwh9rAs7dukH9lUc5W4bfR3r+uFcXm+iHG8kc9HLAdlG7iZ5T6bUQhr/neJnyoLq+70XkC75PUFnYjHXeYgY1W0Zk5fyUmek9qDZ/Ciuj1fe3nSqwCK1h98rKa0hv97pmE3bDDmEmSi3iyxnvoPJocw+U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786924604; c=relaxed/simple; bh=Qvkal74R1egH335vOx3qBPn3Bpf6UiClQE9XMnOZRgs=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=GYuBfRtnZ8kvaTSn4ZQFfs6+NNtWIuwuDFJpSW75EjcTBmYocZobJMEEPo3DWScqv3BUVWu8qbpshAeLe28PsVygw6OqoOvyBsB3r47vCk0AZmFg+NgfTUjm+/1GCaGqtwl3gvyxY9futNisHvdWmxJwEEOhBXXUMP+/cJY2jJ4= 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=GXbZ/28V; arc=none smtp.client-ip=209.85.214.169 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="GXbZ/28V" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2cacb8416a1so26395265ad.1 for ; Sun, 16 Aug 2026 16:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786924602; x=1787529402; 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=GfZg4C+Rx7mhf0/KR0B5Y+MvdvLojqVCPN2v8hs0gwo=; b=GXbZ/28VR6QPYjUTY6PHpV2qKXfr8BGdDAaPhIu79ym+xVwaTfCSFGYzU77imCdO/9 5JKQzprH7wjTI4/LSqckLmRfMjtYQcKWeuLryChTrTYzskCVg/uI2r2BFp2Bgz2J/MlO PuCg4JctcBs4p6xXtXZWr6OZUkDGG3isEPb7iV20bOaK7HYzhrNzuhqlMKv53ceON8A9 t0XZ8dggXxA5GJ5dAoArHVbXjstTv1ngP5jtmu6RLP1Fy/PL184sA9UkbWgE3e0bygny pupb9c3N1GFsJLu42/qUXmTmLJf2dRVlopUVc6o+erWz7opZthl5HP7elpjlexdhek7p Dq7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786924602; x=1787529402; 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=GfZg4C+Rx7mhf0/KR0B5Y+MvdvLojqVCPN2v8hs0gwo=; b=aWO576/aT4742mnDr7bmi1wRGpoqwv9IVfEuVpXeIp+SgSpBTO89o0vVh+yznh0IIF GMLaKTOaVNCzIEbK99GFB3WYWRO6wtVzwxwQIEdrjh7TXtb/YpvlmBJ3OHeu6c/EAR+3 C/BN7zJf9Przg9V2M+iOd3alBWriLFZjww8KHQiWsz7ub8QGm6JAn/42UNvRBgffVziV xyidFFOdKXGIHkVuEkKQPG5sVF8b2SdniYXnhT4869kWqI0rZTU3EOXOk0StitKZ9JTW Qhipl0PWx9FhKQtSok3FKIwRsYE1E1lowwxCdDlV4IoWEo3bRQFzbJcBACSdKy8iAMBy 2RrA== X-Forwarded-Encrypted: i=1; AHgh+RrDOehknco6jlMHv266sPM0ytfY9tGVXKLReOrgAitPS6n/CBY88RJanbFabUyNtPtVfUCZfHrBckBWtmA=@vger.kernel.org X-Gm-Message-State: AOJu0Yx03LbTH5lCNKSm1mEH6PdyVUXqa0qEUc04WbHExvRFD7J+v3Kf Z9tmgcxFnj6G2tFZestadvjJRLC+BvOC+askYAJeuhpHFswrQ7I3b29D X-Gm-Gg: AR+sD11hk4wo0Nqd2aJqvbmY95K6Vi67M84O6zdBN3TvTjDdcRDIwSDe6vYgWChIVFi 8wsJUzXgamdBeq/uFWMfdiwKO2CezztySZQIDYhcpNxO4fdzO/zAH+IB6M6SRPvSW95Yx/xlmKY mrL+0ZZek69IM8rfRVuhIMHA3hcbIycD0RD3AyGtR5/bWTcoaCXKY7cDoOZKs69Tj4iWnQzr5wW o/lXEteYOuPKxAxCdCbNM93RKKX65GAAiFKla41J4roWb/LWCMCa4VhGjlGFyKHKlm6cWRq+KEt U7DaII6qleHu6Ak1ered37p//igUbYsOU2fi3/ly7NmkaTk5xYAg5IMelFIbwYsXCoozfpjtLV2 KcjZ4GcgDxJ/mH8NOw+nsSocRqvTAp1Ti3vBJ1m+Waa5qIMtQKUn8cF0pxOlKaXbRLMydTamtlh VFb2gb17zue9cZ7FceVaLI4dyVUFToO14i1LzojWxC8G5lsH0QPbe+EHSl3kCd+Azk5UDRMa36V hd7GLZgG5orF/KX X-Received: by 2002:a17:903:8d0:b0:2cc:aa36:c04c with SMTP id d9443c01a7336-2d3b0ad0fa1mr237628105ad.1.1786924602338; Sun, 16 Aug 2026 16:56:42 -0700 (PDT) Received: from [192.168.0.13] ([38.34.87.7]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d3aec05092sm26446205ad.82.2026.08.16.16.56.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Aug 2026 16:56:41 -0700 (PDT) Message-ID: Subject: Re: [PATCH bpf-next v2 2/2] selftests/bpf: Cover mixed arena and stack atomics From: Eduard Zingerman To: Yiyang Chen , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Song Liu , Yonghong Song , Jiri Olsa , Emil Tsalapatis , Ihor Solodrai , Shuah Khan , vineet.gupta@linux.dev Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Date: Sun, 16 Aug 2026 16:56:36 -0700 In-Reply-To: <123a014b2b4ecd7d19cbdfe62c62d994e612b6f0.camel@gmail.com> References: <20260816-bpf-next-038-mixed-atomic-v1-v2-0-4644c1886dbc@mails.tsinghua.edu.cn> <20260816-bpf-next-038-mixed-atomic-v1-v2-2-4644c1886dbc@mails.tsinghua.edu.cn> <123a014b2b4ecd7d19cbdfe62c62d994e612b6f0.camel@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 Sun, 2026-08-16 at 16:36 -0700, Eduard Zingerman wrote: > On Sun, 2026-08-16 at 16:17 -0700, Eduard Zingerman wrote: > > On Sun, 2026-08-16 at 10:56 +0000, Yiyang Chen wrote: > > > Add a verifier test with one atomic RMW instruction reached through > > > PTR_TO_ARENA and PTR_TO_STACK paths. The verifier must reject the > > > shared instruction with the existing incompatible-pointer diagnostic. > > >=20 > > > Signed-off-by: Yiyang Chen > > > --- > > > =C2=A0tools/testing/selftests/bpf/progs/verifier_arena.c | 39 +++++++= +++++++++++++++ > > > =C2=A01 file changed, 39 insertions(+) > > >=20 > > > diff --git a/tools/testing/selftests/bpf/progs/verifier_arena.c b/too= ls/testing/selftests/bpf/progs/verifier_arena.c > > > index b241bbcf54a8a..b22bab33301ab 100644 > > > --- a/tools/testing/selftests/bpf/progs/verifier_arena.c > > > +++ b/tools/testing/selftests/bpf/progs/verifier_arena.c > > > @@ -637,6 +637,45 @@ int non_arena_ptr_add_to_arena_ptr(void *ctx) > > > =C2=A0 > > > =C2=A0#endif > > > =C2=A0 > > > +static const struct bpf_insn addr_space_cast_insn =3D { > > > + .code =3D 0xbf, > > > + .dst_reg =3D BPF_REG_7, > > > + .src_reg =3D BPF_REG_7, > > > + .off =3D 1, > > > + .imm =3D 1, > > > +}; > > > + > > > +SEC("socket") > > > +__description("arena and stack atomic at the same instruction") > > > +__failure __msg("same insn cannot be used with different pointers") > > > +__arch_x86_64 > > > +__load_if_JITed() > > > +__naked void mixed_arena_stack_atomic(void) > > > +{ > > > + asm volatile (" \ > > > + r1 =3D %[arena] ll; \ > > > + r6 =3D r10; \ > > > + r6 +=3D -8; \ > > > + r9 =3D 0; \ > > > + *(u64 *)(r6 + 0) =3D r9; \ > > > + r7 =3D 8192; \ > > > + .8byte %[addr_space_cast]; \ > >=20 > > I'm going to fix this to: > >=20 > > r7 =3D addr_space_cast(r7, 0, 1); \ > >=20 > > as in the test case above. > > Waiting for CI [1]. > >=20 > > [1] https://github.com/kernel-patches/bpf/pull/13325 >=20 >=20 > A...and it requires another exception for GCC-BPF: > https://github.com/kernel-patches/bpf/blob/bpf-next_base/ci/vmtest/config= s/DENYLIST.test_progs-bpf_gcc >=20 > Ihor, it's a third time GCC-BPF strikes this weekend. > What do people think about downgrading it to may-fail until the > DENYLIST decreases to something reasonable? I'm not being fair here. ksock series shown a real deficiency in verier logic, matchers in Daniel's series were unstable. Please disregard the above suggestion.