Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp741192pxb; Tue, 5 Apr 2022 21:15:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKyeri4zXTXSsnX7unIpkYxIQ82JUsVqw/EZ/kRYsfdvHZiNNs7kkMEkgCJrcv/pYpmspS X-Received: by 2002:a62:5b44:0:b0:4fd:e026:f4ba with SMTP id p65-20020a625b44000000b004fde026f4bamr6949372pfb.55.1649218511865; Tue, 05 Apr 2022 21:15:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649218511; cv=none; d=google.com; s=arc-20160816; b=yiOiCCnoWZ1LyIYGCRHRYAnYT84cn+Ma5gjsYPJ7mM06U0SQ1kfOQ1UdemcNwroLpK PqTpnC9ljTT/oyZoNLsFzYpjw28Xlx300E+4GYhn/z3JCXm9aVQMi7JqVC5pflwbNXgY httCWZd8dafVuAD/G19hX/iIRhRQTfrtGisIkt1oetKeuVPDG9i3AstRaaiXQpz+9p98 fWKlh45KkA0iXSaTLgmnmNngfgFKrIJirLSvFVvh7aGKHDpT/y4NRLNqbVUPp5UAp1kB iGSEe6bB/yPyxCQcJ9q9K1RuimFQ1bJNnZ0qYik1ThkGHWE+0szQEbReLgDZrI9IkyZR wTyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Bnh/ReO19veFZs0nCvegxdl7eNXssr+Z51g1snEuqTg=; b=V6G4O5ipXBmbqMmwGr1ttLXm4twxq/Y5IfrTHpwoqqcphW+54ji8Cf8cn6mfQr04tR RCYg8yoWNd6oPlD2Ak2CiQAuMo15iyRZX4pqcdlii94FcD9cfdspzHnQVr/edLY4u1JM Z8mo0pgYsD2x9+TCv568P1xcqYAKFVa4ZfynYuOEb6efAEFskcQIGifOyXP512IpCxBJ bnTGxYjoPZmmZZGp2ZhuuovR5O8eMePeBX5+45pEvVyWPZSc+FSIyDdQoxH1RDAXk3WK dOJ4gib6OSVGL9WfpZEDjSi/i9OnE/G4NSVsxR8ePcY3TpoWtBAjjkPkACYwCmKTFlrM 6zFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="RhYI/sa/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y28-20020aa793dc000000b004fac7e6e9fcsi14486650pff.219.2022.04.05.21.15.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 21:15:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="RhYI/sa/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 95EBA3C093D; Tue, 5 Apr 2022 21:07:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1844596AbiDFBud (ORCPT + 99 others); Tue, 5 Apr 2022 21:50:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349300AbiDEJtf (ORCPT ); Tue, 5 Apr 2022 05:49:35 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16A2A13D4F; Tue, 5 Apr 2022 02:43:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 8A2D7CE1C6F; Tue, 5 Apr 2022 09:43:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F867C385A1; Tue, 5 Apr 2022 09:43:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151826; bh=KkqvdNudypKbbtIijKOGeT0cNlIeNDr+yKjHsjcNilc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RhYI/sa/H5n1aIiQ9ZHCuZWK2nNuMEbYr/dkOsXnpPQwLAbaPV94mtRSONhQhQcUR P/wqciFanWps6YzUjbO9MELBmvg37NIP7oBDknbE8Wyb4yxaV4sAepUNQaXUCayXBO U3KF+TIL5TVb8fBq7mQwfrkMREGjjPAje8UNqQnI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jakub Sitnicki , Daniel Borkmann , Martin KaFai Lau , Sasha Levin Subject: [PATCH 5.15 555/913] selftests/bpf: Fix error reporting from sock_fields programs Date: Tue, 5 Apr 2022 09:26:57 +0200 Message-Id: <20220405070356.482811764@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jakub Sitnicki [ Upstream commit a4c9fe0ed4a13e25e43fcd44d9f89bc19ba8fbb7 ] The helper macro that records an error in BPF programs that exercise sock fields access has been inadvertently broken by adaptation work that happened in commit b18c1f0aa477 ("bpf: selftest: Adapt sock_fields test to use skel and global variables"). BPF_NOEXIST flag cannot be used to update BPF_MAP_TYPE_ARRAY. The operation always fails with -EEXIST, which in turn means the error never gets recorded, and the checks for errors always pass. Revert the change in update flags. Fixes: b18c1f0aa477 ("bpf: selftest: Adapt sock_fields test to use skel and global variables") Signed-off-by: Jakub Sitnicki Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220317113920.1068535-2-jakub@cloudflare.com Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/progs/test_sock_fields.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/progs/test_sock_fields.c b/tools/testing/selftests/bpf/progs/test_sock_fields.c index 81b57b9aaaea..7967348b11af 100644 --- a/tools/testing/selftests/bpf/progs/test_sock_fields.c +++ b/tools/testing/selftests/bpf/progs/test_sock_fields.c @@ -113,7 +113,7 @@ static void tpcpy(struct bpf_tcp_sock *dst, #define RET_LOG() ({ \ linum = __LINE__; \ - bpf_map_update_elem(&linum_map, &linum_idx, &linum, BPF_NOEXIST); \ + bpf_map_update_elem(&linum_map, &linum_idx, &linum, BPF_ANY); \ return CG_OK; \ }) -- 2.34.1