From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (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 5125B25B0AD for ; Mon, 1 Jun 2026 05:45:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780292736; cv=none; b=c6d1ECszRRDKOzOtQZA/NeObxzot8iD0kBIRoIAcg5Uis7Cd1Ff/ekngoI0L31aMSJJBaWiuoPcJI+rT/Al43V+U5FnPT0odezRHDbX+Sm2bC6m3X779x/5oniW4++zTh3twSpznxHa52zPqDvQQYzgKVOP4Eq9TYF8Q6LjW6+c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780292736; c=relaxed/simple; bh=39/3PFSkcNJWHUPBkv0omN/oj876F7VG69IVjU8nXAI=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=YQhyRK98kIJlv8z5TvHS7AF8m/QDQU0NaE9oh2SDCCiEDcOLM1BCDiLshodg2NKXHnH398V2NTRXFw8Q/H4vELSVcoBVpsFUAlNdrVGYJHFnGCAifHUKmUZU49nnFxvZF/3yUhjr6xgSgoBbw5iBA7y9YtEzF/peL2ZVPR6eL4c= 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.20251104.gappssmtp.com header.i=@etsalapatis-com.20251104.gappssmtp.com header.b=utDJEGVJ; arc=none smtp.client-ip=209.85.215.174 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.20251104.gappssmtp.com header.i=@etsalapatis-com.20251104.gappssmtp.com header.b="utDJEGVJ" Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-c85893bce34so500749a12.1 for ; Sun, 31 May 2026 22:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=etsalapatis-com.20251104.gappssmtp.com; s=20251104; t=1780292734; x=1780897534; 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=T8Eqep7/7/Qu02hD6m9ahHFR65zImADFmwc1B3Gd9/8=; b=utDJEGVJCWMUrBTTNM9VDEiv0+bqhpbR7xzRMJnp1Y94aA6YnmpBbSs9lVuVjhN1PB x06y1H5caZhe6RLroa1/waekw/f6K68Qtqz5K1pxAAdvNokmGoE5nf5pFg4M3+K1n2GY wwTS+y/uRTFwk9J2kgbjiLPFPeMMZVZMxcO8AbN11ta8RIBgZUQDNlHRZOB049XVBhdU GzJIqwWliwWeVTdlpHZKb1oJK4YZjteKXzhByxzgcbezFscH3NqOqJgeyXMlD4GrCCaT exDWt9RiJNo2F8kATw3LSh6Bf2Iv7fZnVHKtcXNoZhQNZ9RdPsEP02hRbG+WfQW/hbXe +ypA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780292734; x=1780897534; 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=T8Eqep7/7/Qu02hD6m9ahHFR65zImADFmwc1B3Gd9/8=; b=kzrzL//xeOHkRTCemMNyqGCLGgeHyVhtpbNPHRDQw7Ohe/y+uRs5Tx7SRKOSdh6zpo RcGaPtuYBNz4fG2y+Ji2e0U/1UuJGMz2hG2xRny8Yhst35Sf2GphZy2NEGNgXke4Wvjm ugIXxR98biagzZumix3HF5q3LAVTk/DQiwSleLpMoaBkQjz8lfTLvZYtxEuSgojf7Ztr 1zIFZdkmuTXXFj1S6iUJVbPrwkwq9wCY9aNvybEoGyNE9/Tfu0W/hVNdXlOK5QYSqmQ1 vu+NHdgqokHL4CR4jv7zYQfTSUqd1krKt81gHlca5pzx7+U76gPq7Y9hVSpILKgXe3s6 rRRA== X-Forwarded-Encrypted: i=1; AFNElJ+MF1ZymT2CQvqKRvtn+NUKx9zcajEh/RAHUZ/HsdT+k803MP1QIVlrSKv8alHmt5vno1VbMhnykQBuBLY=@vger.kernel.org X-Gm-Message-State: AOJu0YxHE0IRpHdFsMCXOQi2sqYgNtg/JSNs1er8S3SP+MztaCtxvLgD h+qpFb2AANXCzBqXW8HXWv0p+skiDFUkU0plQvrl2og0t37Ibturmi2RAx8TN/fEYWU= X-Gm-Gg: Acq92OFsyfmikVmnYWNwpqnGZ2NrqWf6zNGh+P6AqarVnjC8T4g9OPTa40gGc91pnpI zSR2J8KysUPK4mwWbPXrgMwolU6bd4vHDXdEELNZDVKw3nzLLdaaFzP4J3yYOk9SKgmUvBWVSqm CWMe8/mwGQht1OPdz+B4EQaMsOxWCPIdrWNxVsFU0smw5Xv2eiDhQ4AENbBgF1DtOhx9Lqf0TK5 sIkXPMDtF55w1FjgmTYS64KZHks+OOO5bDxuMh3dPisJ31AsaFtScxw+JMMdczA2g8IV5x1ZArq fRz3MiLs/GfmFvLL6ng+KAO/8PmrrMhl8yljGu1FDtvBuzuzh41AhnJDsv2I4Dck/MCYu5jrf0+ bOsw9dVVVKXViDc6ASGOJQkG+P/SUkxWPToZ13i173feNZqLR/AL/6zu80xv5S9r0qOwvxbUhJx TDsoUgbJnVP8uUmPcM9B363kRVQXRqu0NdT1c= X-Received: by 2002:a05:6a21:6089:b0:398:b95c:51ed with SMTP id adf61e73a8af0-3b4281db742mr10663823637.35.1780292734609; Sun, 31 May 2026 22:45:34 -0700 (PDT) Received: from localhost ([2001:569:58a0:da00:a5c8:c4ce:f7c1:40c1]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c8583333e80sm6466873a12.18.2026.05.31.22.45.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 31 May 2026 22:45:34 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@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: Mon, 01 Jun 2026 01:45:33 -0400 Message-Id: Cc: "Alexei Starovoitov" , "Daniel Borkmann" , "Andrii Nakryiko" , "Martin KaFai Lau" , "Eduard Zingerman" , "Kumar Kartikeya Dwivedi" , "Yonghong Song" , "Stanislav Fomichev" , "YiFei Zhu" , "Matt Bobrowski" , "Quan Sun" <2022090917019@std.uestc.edu.cn> Subject: Re: [PATCH bpf v3 2/3] selftests/bpf: Fix cgroup bpf tests broken by bpf_set_retval validation From: "Emil Tsalapatis" To: "Xu Kuohai" , , X-Mailer: aerc 0.21.0-0-g5549850facc2 References: <20260530101239.590395-1-xukuohai@huaweicloud.com> <20260530101239.590395-3-xukuohai@huaweicloud.com> In-Reply-To: <20260530101239.590395-3-xukuohai@huaweicloud.com> On Sat May 30, 2026 at 6:12 AM EDT, Xu Kuohai wrote: > From: Xu Kuohai > > Add explicit return value checks for cgroup bpf progs rejected by the > bpf_set_retval validation. > > Signed-off-by: Xu Kuohai Since these tests are breaking with patch 1 you should put this patch before them to avoid the breakage in the first place. > --- > .../selftests/bpf/progs/cgroup_getset_retval_hooks.c | 6 +++++- > tools/testing/selftests/bpf/progs/sk_bypass_prot_mem.c | 2 ++ > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/bpf/progs/cgroup_getset_retval_hooks= .c b/tools/testing/selftests/bpf/progs/cgroup_getset_retval_hooks.c > index 13dfb4bbfd28..c0bfa2d12dc7 100644 > --- a/tools/testing/selftests/bpf/progs/cgroup_getset_retval_hooks.c > +++ b/tools/testing/selftests/bpf/progs/cgroup_getset_retval_hooks.c > @@ -2,12 +2,16 @@ > =20 > #include > #include > +#include > +#include "err.h" > =20 > #define BPF_RETVAL_HOOK(name, section, ctx, expected_err) \ > __attribute__((__section__("?" section))) \ > int name(struct ctx *_ctx) \ > { \ > - bpf_set_retval(bpf_get_retval()); \ > + int val =3D bpf_get_retval(); \ > + set_if_not_errno_or_zero(val, -EFAULT); \ > + bpf_set_retval(val); \ > return 1; \ > } > =20 > diff --git a/tools/testing/selftests/bpf/progs/sk_bypass_prot_mem.c b/too= ls/testing/selftests/bpf/progs/sk_bypass_prot_mem.c > index 09a00d11ffcc..bae5283fca6b 100644 > --- a/tools/testing/selftests/bpf/progs/sk_bypass_prot_mem.c > +++ b/tools/testing/selftests/bpf/progs/sk_bypass_prot_mem.c > @@ -5,6 +5,7 @@ > #include > #include > #include > +#include "err.h" > =20 > extern int tcp_memory_per_cpu_fw_alloc __ksym; > extern int udp_memory_per_cpu_fw_alloc __ksym; > @@ -97,6 +98,7 @@ int sock_create(struct bpf_sock *ctx) > return 1; > =20 > err: > + set_if_not_errno_or_zero(err, -EFAULT); > bpf_set_retval(err); > return 0; > }