From patchwork Tue Oct 5 08:26:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Ambardar X-Patchwork-Id: 12535823 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18F75C433FE for ; Tue, 5 Oct 2021 08:30:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE82361425 for ; Tue, 5 Oct 2021 08:30:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232658AbhJEIc2 (ORCPT ); Tue, 5 Oct 2021 04:32:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233318AbhJEIc2 (ORCPT ); Tue, 5 Oct 2021 04:32:28 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C36FDC061749; Tue, 5 Oct 2021 01:30:37 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id v11so6509478pgb.8; Tue, 05 Oct 2021 01:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fBG696NEpSwIBlXH0TMuXB909IPwtFq8p/NuyOUiOsc=; b=BKMM/GwyCarVz0hwngv5UYK5qMe4WkDZ/1BzG/8T/F9CD1/Hl5nut7LDe/ddtScEOx kt2zL4wNzs2P+QjlInsdup5DqqVNx0DLFXN7/rw3i8dGTlRZRv299Xe90KZvKHDM1Pkr zwUGf5pTKUCj3afYs51uVZVd3KZqvz1zq6RT5JiSAUmw+MV8cSBMCUIBDiLXAAwyB+bE UCuBiLvllVDu5hjAecjbz8a+1KZrjQrmQL0FokivnfSbW60R4tL7JK4ov5+LK7qc5NgA MWOzOySfcufv3Twi1vUCYBUuEQN3VLkbAbnUhW8nMbKCNU8cpairduMyCHOIhE/7qWhl owjg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=fBG696NEpSwIBlXH0TMuXB909IPwtFq8p/NuyOUiOsc=; b=QxtsAREiX/YwVuTyGU84c1MwLVFmnQ3+XyTfAmnepc0VCUTCwhS0mIy9jZi5dQqwit jwO90I8PIZPjXUDuYqg04aLsyBoamEd0FgbIy6dfstogcOVHClbEaw7cXEtT4qTeakg9 xqMq+NYUGNVcrXytwOLxTClKs0WeB5eC8HN8rVqLMjRiX1d/OteTSETeL0Pd9134c+eP uu/BoUjRNP7jq9SU4f0y+h2FPjhTEW29E0EBofeSi/p2VqFhFMmRH2jFRRhC03dfA4Pj CQnOxb78FmZtpBUQladmM7aKa2KnVqUe8K/7shXjh9j1HbhdNB4gClB1Zy10JdpUVEyh O5KA== X-Gm-Message-State: AOAM530QwibgBg5w1qawnCGpNyJslDz9/2iVkyisqndV09zLi5vq4ep4 6AakBc8545XGHyEQKIEx9Kk= X-Google-Smtp-Source: ABdhPJwhMimbJz9LYq+FXgDCm1WqNWV59ayamwzKcBveNHS/UiEkra2KlzEfbrjeP80lIYeSs6M8ow== X-Received: by 2002:aa7:9005:0:b0:44b:fa4e:95c2 with SMTP id m5-20020aa79005000000b0044bfa4e95c2mr28003296pfo.29.1633422637435; Tue, 05 Oct 2021 01:30:37 -0700 (PDT) Received: from localhost.localdomain ([2001:470:e92d:10:78ba:4bcc:a59a:2284]) by smtp.gmail.com with ESMTPSA id a15sm4941257pfg.53.2021.10.05.01.30.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 01:30:37 -0700 (PDT) From: Tony Ambardar X-Google-Original-From: Tony Ambardar To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Thomas Bogendoerfer , Paul Burton Cc: Tony Ambardar , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-mips@vger.kernel.org, Johan Almbladh , Tiezhu Yang , Hassan Naveed , David Daney , Luke Nelson , Serge Semin , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh Subject: [RFC PATCH bpf-next v2 04/16] MIPS: eBPF: support BPF_JMP32 in JIT static analysis Date: Tue, 5 Oct 2021 01:26:48 -0700 Message-Id: <8ca5dfaa9ad749e643f9246d2434c12a1c21150a.1633392335.git.Tony.Ambardar@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net X-Patchwork-State: RFC While the MIPS64 JIT rejects programs with JMP32 insns, it still performs initial static analysis. Add support in reg_val_propagate_range() for BPF_JMP32, fixing kernel log WARNINGs ("Unhandled BPF_JMP case") seen during JIT testing. Handle code BPF_JMP32 the same as BPF_JMP. Fixes: 092ed0968bb6 ("bpf: verifier support JMP32") Signed-off-by: Tony Ambardar --- arch/mips/net/ebpf_jit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/net/ebpf_jit.c b/arch/mips/net/ebpf_jit.c index b41ebcfb90c4..dbde5d6eefa6 100644 --- a/arch/mips/net/ebpf_jit.c +++ b/arch/mips/net/ebpf_jit.c @@ -1686,6 +1686,7 @@ static int reg_val_propagate_range(struct jit_ctx *ctx, u64 initial_rvt, rvt[idx] |= RVT_DONE; break; case BPF_JMP: + case BPF_JMP32: switch (BPF_OP(insn->code)) { case BPF_EXIT: rvt[idx] = RVT_DONE | exit_rvt;