Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1204398pxy; Thu, 29 Apr 2021 01:49:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkY8BWwW4ggyxvYRBhaOFFGOKkpq9FPKEgN/qUItGzcuUjhNspY5JSZNbO4V0ifzHObnRD X-Received: by 2002:a05:6402:37a:: with SMTP id s26mr16947664edw.159.1619686187820; Thu, 29 Apr 2021 01:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619686187; cv=none; d=google.com; s=arc-20160816; b=ehP2VhC89jekYY6bybTzEhORe/rSsxje0Affs9F5n44RMVEVaTiHBFSVNmI76428kR 9f6xlwfHCMlHq5gfcokcXfAcr2f5OYlFXxHnwCjt8tR6zDGUu+Fk7QgXaySya70UrVUb O3g9bezEKrnDDbfrDGOq4cUPkzdNulE/bmcSlNRW71gv7rIx9smrxAAnK3oBnPa1//iB yanuqEvn824XSfe5YDy/H7jegeiD8s79v8TUlss9YeOTjXcTF4e85mCr5AqlwX4pMQsi UbqQHMHT22L4uzFBU+kLZfYd/tMANYBXAi97Uq6V5FwaqRasKRKLp/7GnwFQuSHQljyC xVpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=bYJ/i+SyDWuXeltdyQRtqtcL95TciOlmlQ2w0jknE48=; b=l5vqzdIdq658zoYfrOXS1+MkAY3OkO5sXL0fx5P7Qk+6aXRk0n3Ux7cnIFgCFTXlJb NWW2Iy3SwPirm8gtzezWuiiL7g4xTk00Jl+bb+rwz+Yvz3Z+aWJXuWnid+NyqZHUFuDV PONALNrxVV/oBBtB1bBAOeCtcr4RK2SsPxhJKE1hL6NDfkQmDMADskpY3W7auKFsKIxq Oi36zzyFUjm84sdo7TheDtsFIob8e4lVL4rPj+jVyOv+Bm27osAn85TE1FScX8kJVEk6 lKgJmG/LmS1uqK2DM+kV+Fez8i0pvGD7v55ML3TfhmSbndyj1zKW07v+B5T5YX6IjftE FqYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="pL/eJr3n"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f20si2498633ejx.483.2021.04.29.01.49.24; Thu, 29 Apr 2021 01:49:47 -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=@google.com header.s=20161025 header.b="pL/eJr3n"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232714AbhD2IrG (ORCPT + 99 others); Thu, 29 Apr 2021 04:47:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229963AbhD2IrF (ORCPT ); Thu, 29 Apr 2021 04:47:05 -0400 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C021C06138C for ; Thu, 29 Apr 2021 01:46:19 -0700 (PDT) Received: by mail-oi1-x231.google.com with SMTP id t24so8399458oic.10 for ; Thu, 29 Apr 2021 01:46:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bYJ/i+SyDWuXeltdyQRtqtcL95TciOlmlQ2w0jknE48=; b=pL/eJr3nZ1xPXLcRvl0U4RW4El5I8fT5ZC3v52Qmlslf9BOJWoOnByIYODbo7VWxZN gvNtg2QGNUyVoKYRtfdyuchvx2ZUZczbs/bhGEgyt3Kyh73GiDnclQczVT3mWr1tNnVF n8jvU4dfHi25Dns1SHDJJW7HWJzxfAvoVX/Za5OJoueFl8wCOnNX5g40cfRddEas7dln 4ooWV7jq0UDZwy6gz6025xNHxdIqg7qF9rhuiF3ds/2Sg9hjzM0JLq4ipWf4sxnj0dWW WvXstLLdiaOeVizGBD/xIIJBj7j+rNoCtfHxsn684meB9CcHSoHwTwapwZLWUr8Iz5KB F7rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bYJ/i+SyDWuXeltdyQRtqtcL95TciOlmlQ2w0jknE48=; b=luuk0njeMGHibR91NDjuJneBINaP+bMahaRK4nUKf+hDWJuGH2CbQboxFgwQKTzXzt C3Ea9k0xUrxJ6Nhf1jogeiLZp9A8ly6VgrUy5SOW3TBfPhfjHDFYb262SBypVI3xII9j 8TBwoSEmajFB0233dlM7gdOUJiPo+hW+FDLv98WACfxY/KYeN94nKELxizR41BhYJXgf pUyFxyq6+Ug6LthE3v4zUo9HyHiHz55cdNVuXbJeSGmEZ1DcCOh0D/vIHmoVOJMfi2SB NKAhQmEFZX78W7qKRPx7rbIHGQB7snNrhaT4xQa1gMrBPyg1ZJsJHaEXc+NKFuG72BoW NrHQ== X-Gm-Message-State: AOAM530bNbSbTshzTOfkrAgWrnVfFM0v3zzFi13mEkbX6FQPhkllXYbv pRaMGay9apo3TjZL+rkoxgfgEZg+98ohGb078wEHRA== X-Received: by 2002:aca:a814:: with SMTP id r20mr1142692oie.104.1619685978667; Thu, 29 Apr 2021 01:46:18 -0700 (PDT) MIME-Version: 1.0 References: <20210427170859.579924-1-jackmanb@google.com> In-Reply-To: From: Brendan Jackman Date: Thu, 29 Apr 2021 10:46:06 +0200 Message-ID: Subject: Re: [PATCH bpf-next] libbpf: Fix signed overflow in ringbuf_process_ring To: Andrii Nakryiko Cc: KP Singh , bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Apr 2021 at 20:13, Andrii Nakryiko wrote: ... > > Yep, let's cap. But to not penalize a hot loop with extra checks. > Let's use int64_t internally for counting and only cap it before the > return. Cool, sounds good. Patch incoming but I'm on interrupts duty this week so might not be today/tomorrow.