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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 015D8C433ED for ; Thu, 29 Apr 2021 08:46:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB5FE6141E for ; Thu, 29 Apr 2021 08:46:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239885AbhD2IrH (ORCPT ); Thu, 29 Apr 2021 04:47:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234041AbhD2IrH (ORCPT ); Thu, 29 Apr 2021 04:47:07 -0400 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74500C06138B for ; Thu, 29 Apr 2021 01:46:19 -0700 (PDT) Received: by mail-oi1-x232.google.com with SMTP id e25so35839108oii.2 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=FhgPJXmgRXfPZ5d9TgYvsCxKSOmqZHOMBzjl2wcH+Ep15dgW1X71zzUVeyCu5PZEt8 A3cnen/pCYpS0ITu6Iy3JUitDo0P+wxYlZIBpOk8UcRlQqaTT6XBMCmXlrMzoWwDODVy C64YmQxCEJ6jZm7wd1P/aOxxlRn1ss2ij4Bw2p/qhkMMZAMcuxEaLfxmeWQrYbX8X5Py F7Ts1Z4lfOBNzzq7wxHNUc0DUgWytNsjZNYBabNHBsHECkPwyAss09EAshuZ5QP3gPp3 /Zb4KDPl9kIEm3tKmI0dZXcQBsM4y5b4BFdS2sU2JEYAAGyWBroNvRqr/MeDP5XYbvYM 1QxA== X-Gm-Message-State: AOAM531+CTmdG9yb4Vp9wzu0RfUnUL6+CvEOf/s2H+a3GIttbn534X3j ic01S9pYSbmqfZ2Um1NSWip3mfN2mCaRAMYEUXwycA== X-Google-Smtp-Source: ABdhPJyCkp8J3VRA0ewFkoQykIwlYkcZbVoeMyqGaTtHvZE/zViErogzzqFjCPiXR/2ErhCqVeYfbzmswfnNNdh7rQs= 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: bpf@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.