Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2281751pxk; Mon, 14 Sep 2020 09:09:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPGvafqM41JUD8ViJpDtjTXeM1XvD5A/1bEEnZjlKB4du0mBLeEU2Wnqa35Z1gabfMUH+b X-Received: by 2002:aa7:d558:: with SMTP id u24mr18105494edr.336.1600099796809; Mon, 14 Sep 2020 09:09:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600099796; cv=none; d=google.com; s=arc-20160816; b=dBPDTslUZFebg2qsweOUoDu1eP9TXi6lgaLK1vPI8VNF+qELGUEAGoJelT9o/LfmFM xNhSd/vjrjLOV2cRYzSTJs7qDjJlY3NF75yipNbzaOVcFhZqUZTcti3vGQvnj3bFcw4u CoKc1E2xX4Pq26QQlYU7114s4ZMXUiFnEHoIXQl8xjrGtIJaMBs2sjwUnWtdBEzCQlZ+ MEqE3c7+GZ6XUijRn5Nf7cWKhoo05ULYrQljKcIqoFpp0SvhsHjiLa3H+D/9qSYvITtj udOBSiDaufI1zApqIhDCfa96PDaeLAI0rIZF/yskLfU2g2+n3LU0RYCIFMst9u37VnaN iyQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=n6LtCGvrAXE3QiE4qfJQGgn89kMaY1QEsIyHXiYtTTc=; b=1GOdP72wOEgsL+2wUCVF9jWaUOZPLJ9PE0nppgtHZPnXNNxO7sBkpTct2w+suz1nom ryzziekgiqNTdsjHWXSWuncDSKZYAk/KGsTECgOS5dY+9q2GPgnbCxyip730FSD/vS8e 0UrVTcsLhyPgdRD8FLmRxU1VSfNsL8C67OwAkhiyVjJSttjPAqNb9fnWblIkPYiMCg2L iAhQZWAxgl/e+MA5P+2NktjeA4twpuiZCwLYW1gqxRQlEZfQOByZHBUsSNGoX5yJWsh9 jvP/rG1ES8zlrPORUFpPn7a/wd6EHxLp8pCcYo8rpGUo3NSo86p6sGXheEZp/rnakhqR uzcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uMO0rA52; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c12si7829313edk.238.2020.09.14.09.09.34; Mon, 14 Sep 2020 09:09:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uMO0rA52; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726399AbgINQFR (ORCPT + 99 others); Mon, 14 Sep 2020 12:05:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726061AbgINQCV (ORCPT ); Mon, 14 Sep 2020 12:02:21 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11CC1C06178B for ; Mon, 14 Sep 2020 09:02:06 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id s12so188564wrw.11 for ; Mon, 14 Sep 2020 09:02:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=n6LtCGvrAXE3QiE4qfJQGgn89kMaY1QEsIyHXiYtTTc=; b=uMO0rA52/BJZa3hesvspLsRNPKOgvDHB48G3FFPOnOTHBvO/7rzHvbZH+I+ezWRfER gGgQ5y/XC6V89t9/Cnj0yTvVFYqa6YvbsNVA/4QPyivhzcUj6JdwA3IZpyMJrpBO6EFj RIXJMmdGYuChKvDCXMTRC6UAL3aHZHAi4LIWcQ/UYrymAp9TxuevXWznP3BcpYb6mpu4 BhL9hIZUOeg/xF6oeIJr/pByUK6pVGXKdkctS3rVaFPczGwl5CmdAhihkzkrSDzQHasD Cv9ebamJkPytXiJLcbdH3bmbaAa1hgqXzVeH4C3gixvhKmpVX10AZXpvmHt3fxzpriPk nDVQ== 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:references :mime-version:content-disposition:in-reply-to; bh=n6LtCGvrAXE3QiE4qfJQGgn89kMaY1QEsIyHXiYtTTc=; b=sjNQAdZUUYoW3EqhWrZvSIqROVtNjLmps/070E2/Ey7UWiTkEeEH0km25lelotidFD OEOnlic+oI/GMHn7nodqZ9EkhWPXj7CqC/sNpuargOWexK/14R9UCbyW6+HM7F17bLd0 l/2XYcGNzjAf7UlInOBFSEV7hYv+kfrUGPoYw6TQfwW3+K8VPQ6jgNRj6Dsi6IDA+OsY btIwEh9rRQiRxmFdMLBW6VyUKd18ZlJS/eR7SFH52xRdSUHOfQ79olIeK833AITaexN8 MlB6M7h4Mk2dMeIV282NxZk4Tq4synIFua7wLxlrqu+mjGlC1mxQZpHYZ1+Y+KxsgXsc gXAA== X-Gm-Message-State: AOAM531voALA26QDFzjvIChhvELuyuBcSMtq8DGRD+6NwwHM86oB9ETV 6CgIcAciIK/VWsHrfYl1vjepeg== X-Received: by 2002:a5d:4c90:: with SMTP id z16mr17678413wrs.170.1600099324621; Mon, 14 Sep 2020 09:02:04 -0700 (PDT) Received: from apalos.home (athedsl-246545.home.otenet.gr. [85.73.10.175]) by smtp.gmail.com with ESMTPSA id v204sm20508924wmg.20.2020.09.14.09.02.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 09:02:04 -0700 (PDT) Date: Mon, 14 Sep 2020 19:02:00 +0300 From: Ilias Apalodimas To: Will Deacon Cc: bpf@vger.kernel.org, ardb@kernel.org, naresh.kamboju@linaro.org, Jean-Philippe Brucker , Yauheni Kaliuta , Daniel Borkmann , Alexei Starovoitov , Zi Shen Lim , Catalin Marinas , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: bpf: Fix branch offset in JIT Message-ID: <20200914160200.GA19026@apalos.home> References: <20200914083622.116554-1-ilias.apalodimas@linaro.org> <20200914122042.GA24441@willie-the-truck> <20200914123504.GA124316@apalos.home> <20200914132350.GA126552@apalos.home> <20200914140114.GG24441@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200914140114.GG24441@willie-the-truck> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Will, On Mon, Sep 14, 2020 at 03:01:15PM +0100, Will Deacon wrote: > Hi Ilias, > [...] > > > > > > > > No Fixes: tag? > > > > > > I'll re-spin and apply one > > > > > Any suggestion on any Fixes I should apply? The original code was 'correct' and > > broke only when bounded loops and their self-tests were introduced. > > Ouch, that's pretty bad as it means nobody is regression testing BPF on > arm64 with mainline. Damn. That might not be entirely true. Since offset is a pointer, there's a chance (and a pretty high one according to my reproducer) that the offset[-1] value happens to be 0. In that case the tests will pass fine. I can reproduce the bug approximately 1 every 6-7 passes here. I'll send a v2 shortly fixing the tags and adding a few comments on the code, which will hopefully make future reading easier. Cheers /Ilias