From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56FFCC43603 for ; Mon, 9 Dec 2019 18:51:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2739F206D3 for ; Mon, 9 Dec 2019 18:51:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726408AbfLISvz (ORCPT ); Mon, 9 Dec 2019 13:51:55 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38917 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726354AbfLISvz (ORCPT ); Mon, 9 Dec 2019 13:51:55 -0500 Received: by mail-wr1-f65.google.com with SMTP id y11so17364128wrt.6; Mon, 09 Dec 2019 10:51:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=h+sQ4sK8cIE8NAUw1oXiUPeww5UNSFO+9BWSRabj8Io=; b=B7MyiEEhBBSdOrGyxZpoeddOabWDXdGIMSeVgYqQHBdnkK+l0rrIOTeEm/3TAwwiYG YUYonnxaYsSCkFWpqddNQ48eiHtJTA5yDTHA5OA6TitCyV4kjXluxix6dMk/HxYn2pNl 5Dii7XoL+q34CRNPQE1itg647Ho3yImjqoh3jTvkN98E6JVGdOhzV/H91A1wPZPtF1QD oEUjQHeAxjVfZGTTYLea0FuhEFBqA3NyL2zGwdJMuvaPE76uAp9JNFd0PhGyunQ/lsgw sJm/cDADVbFR+hQx+ApkVW4y3cry/CAxTSs8mlb3rz7rt1iIpJc6Tgreh45pym6WtXHA NgjA== X-Gm-Message-State: APjAAAVmQq6Bjr4LN5iEbrpaWdhxwII/EVYwamAesDwzwbDcwNxu6B+G cCVMg9f+q6lgQ7q1/0mWpL8= X-Google-Smtp-Source: APXvYqz2GpJMlLqv85B7cSey8jLFDodJd7CJ/le5Ct4Rya8RPS47FI9WVWSctcZgBWubsiHCXPmXsw== X-Received: by 2002:adf:dc4b:: with SMTP id m11mr3739018wrj.344.1575917513422; Mon, 09 Dec 2019 10:51:53 -0800 (PST) Received: from Jitter (lfbn-idf1-1-987-41.w86-238.abo.wanadoo.fr. [86.238.65.41]) by smtp.gmail.com with ESMTPSA id q3sm433905wrn.33.2019.12.09.10.51.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2019 10:51:53 -0800 (PST) Date: Mon, 9 Dec 2019 19:51:52 +0100 From: Paul Chaignon To: Paul Burton , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= Cc: Mahshid Khezri , paul.chaignon@gmail.com, bpf@vger.kernel.org, netdev@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko Subject: [PATCH bpf 0/2] Limit tail calls to 33 in all JIT compilers Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org The BPF interpreter and all JIT compilers, except RISC-V's and MIPS', enforce a 33-tail calls limit at runtime. Because of this discrepancy, a BPF program can have a different behavior and output depending on whether it is interpreted or JIT compiled, or depending on the underlying architecture. This patchset changes the RISC-V and MIPS JIT compilers to limit tail calls to 33 instead of 32. I have checked other BPF JIT compilers for the same discrepancy. Paul Chaignon (2): bpf, riscv: limit to 33 tail calls bpf, mips: limit to 33 tail calls arch/mips/net/ebpf_jit.c | 9 +++++---- arch/riscv/net/bpf_jit_comp.c | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) -- 2.17.1