From patchwork Thu Mar 10 11:02:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= X-Patchwork-Id: 12776151 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68C83C433F5 for ; Thu, 10 Mar 2022 11:02:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238350AbiCJLDk (ORCPT ); Thu, 10 Mar 2022 06:03:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235037AbiCJLDj (ORCPT ); Thu, 10 Mar 2022 06:03:39 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DC3A865DE for ; Thu, 10 Mar 2022 03:02:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646910157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3YkGvyVq/I4joIsjY6Ig9+NmZe2zrWU3ce/aUwJiE8c=; b=aOmsABCIVoMaqOyW4BfjFMEapsj1rnUVMnIdG4DlHlj7/KAdXTSA/EzLmKijErdWkgbgn4 owfhDC8SU70rYv9g+je0lyogHbAjdY/mlndfMMEVGr6zSBzo1pu4+NVqiQarXytpDdaqco XOBGKcs3TIU/TN6mjPMfb/BWnIPdUBw= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-86-IFVMT1N2OxO_zbYIjaHxyw-1; Thu, 10 Mar 2022 06:02:35 -0500 X-MC-Unique: IFVMT1N2OxO_zbYIjaHxyw-1 Received: by mail-ed1-f71.google.com with SMTP id b24-20020a50e798000000b0041631767675so2895157edn.23 for ; Thu, 10 Mar 2022 03:02:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3YkGvyVq/I4joIsjY6Ig9+NmZe2zrWU3ce/aUwJiE8c=; b=60H8RyuQgyI/T9yuEu2GjP9vAscAPTDwHJChGfbQ9jevEoD8jTnZkQKx2ynIN+NuNL 8+SC6Ubs83yUWb4x77oamfunJXGHV94322mh+rrafKBfRuC72zCLjfRq0rOwgi0P5TWn /wsWSwmezodNT5D9oYQM/NZs2AjAwuWAhnezSh0A85+kk9am/X5u4V/NW76W62Em4E/r IUdI0Gi25K949SvF4m2itzxgjaBhScLOgg3hG2Ei1GUmuHOHoX5jXMXyiCTt0b4zRwvE Kqq66mneaGNqPvkXaKR6M0yU8dyCXOZ952TLffdP1Ad/nmjHn0yK74chOWuPVsvvGdwM HKKA== X-Gm-Message-State: AOAM530ijB4efyz/1schXbNHpVGjwomaGZMYoulDjVQs62mrce/KfsPK Cjf0vpPacpQ45QCAXmAL5DnP8n39XWbXf0OOyeLWIPx4NdD3B1uv+9SXVB4q1/J3a8bOJeskTDz XCfxCdhzXVzMZJRJy X-Received: by 2002:a17:907:9485:b0:6db:331:591e with SMTP id dm5-20020a170907948500b006db0331591emr3602909ejc.478.1646910153956; Thu, 10 Mar 2022 03:02:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwanO7L3hNOd+MuVKT3aE8AD0/A95WmIdMlHB/jhjQXPOhasyxgGufXAhlmCNCMVmVxV3u0SQ== X-Received: by 2002:a17:907:9485:b0:6db:331:591e with SMTP id dm5-20020a170907948500b006db0331591emr3602761ejc.478.1646910151616; Thu, 10 Mar 2022 03:02:31 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id u19-20020a170906125300b006ceb043c8e1sm1717294eja.91.2022.03.10.03.02.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Mar 2022 03:02:31 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 7E5A7192CC1; Thu, 10 Mar 2022 12:02:30 +0100 (CET) From: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= Cc: kernel test robot , Dan Carpenter , netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH bpf-next] bpf: initialise retval in bpf_prog_test_run_xdp() Date: Thu, 10 Mar 2022 12:02:28 +0100 Message-Id: <20220310110228.161869-1-toke@redhat.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net The kernel test robot pointed out that the newly added bpf_test_run_xdp_live() runner doesn't set the retval in the caller (by design), which means that the variable can be passed unitialised to bpf_test_finish(). Fix this by initialising the variable properly. Fixes: b530e9e1063e ("bpf: Add "live packet" mode for XDP in BPF_PROG_RUN") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Toke Høiland-Jørgensen --- net/bpf/test_run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c index 25169908be4a..0acdc37c8415 100644 --- a/net/bpf/test_run.c +++ b/net/bpf/test_run.c @@ -1207,9 +1207,9 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr, bool do_live = (kattr->test.flags & BPF_F_TEST_XDP_LIVE_FRAMES); u32 tailroom = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); u32 batch_size = kattr->test.batch_size; + u32 retval = 0, duration, max_data_sz; u32 size = kattr->test.data_size_in; u32 headroom = XDP_PACKET_HEADROOM; - u32 retval, duration, max_data_sz; u32 repeat = kattr->test.repeat; struct netdev_rx_queue *rxqueue; struct skb_shared_info *sinfo;