Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp366443pxb; Wed, 14 Apr 2021 18:02:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHC6qu6nsAd8Ce20v0CoCnQrDeb1rVzykxLCwcli20R3Iww6WK/Fn1Om+es5soau/1puBr X-Received: by 2002:aa7:d7d1:: with SMTP id e17mr1114027eds.84.1618448527758; Wed, 14 Apr 2021 18:02:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618448527; cv=none; d=google.com; s=arc-20160816; b=ua+tJqn9S0DpN+siQrImPSVT/0qD2qnaCXjtTFUcT6R/4sFms7x2DPXz7xUejJeY7C wXfGVVzYlnEM5Af8p3/L9q0tU87A9gnuVoeGzrAgfcYBhWWzDtpplXS3fgPiHPjyi9wU FxHH0cy1JOit3ocxOqRR6dSOkmQ3iU1+hxa68PdVyYWbb7SoUyO7TVRYHpEfMNTYnTeD F0T2knIC0MexRQr5MyN/Gc+Ms+Cl08hafyS3TH62obkyAH+2RHupvAlz2EynpkWgBbMg qlsQQRHh7gMD744GJ9j43pJhH/9ApYQ/XQbtE3tzrCBszWRNIArI67Yhno1q4vaauQAm 3oQw== 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=9nV9RJgL5nqXsnEN27udq8GpkpJZtoA2KkXDX+mgAJY=; b=MJ14l9oppP32X4NwchYIwtOkxcq5WUcXb31dbcJ3iDYxmGny2ratgn+0GPutXJxPJa cMzO9mfBBnVAoDaDwZhT2ZrTBQ8vegO3BmCnAJ85PwwA6oAUO1cmBU0aXIq3r0tuf1AD Hnn8KtFDTQu8i4Nlcsk/o9E3v38EvCic61kff+y6NebC0DJqy7lc48GXVdASkxrN5ZUs U4HdLgRQB2e+ZENUudWo0bZ3AFrWRfxxFqXZQxCTxZ3LC1jhEYUMJnnCSR4jMt8FXENx uPodWtMiGqJPfIQLFqvpROgdWTo78PWB7IbpzuGa/HgrhgyZFxxgiUyUOA74+lbyMNoz i3UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PPA67RnK; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si975676edw.305.2021.04.14.18.01.44; Wed, 14 Apr 2021 18:02:07 -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=@gmail.com header.s=20161025 header.b=PPA67RnK; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233860AbhDNW6n (ORCPT + 99 others); Wed, 14 Apr 2021 18:58:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232336AbhDNW6m (ORCPT ); Wed, 14 Apr 2021 18:58:42 -0400 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4461FC061574; Wed, 14 Apr 2021 15:58:19 -0700 (PDT) Received: by mail-yb1-xb2d.google.com with SMTP id x76so13963889ybe.5; Wed, 14 Apr 2021 15:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9nV9RJgL5nqXsnEN27udq8GpkpJZtoA2KkXDX+mgAJY=; b=PPA67RnK9YC3zRliV29IsSpCuJwygYp0SRM2nx+35yYKGpoWjehFsK3KKUN1Yh9zSa nZq51wU7KbuQTMKQWHEVbL12ZhGwFopFb2vpRXQyPS3Gu9r9b3werKtWZQoaZ87H8NrW ydA9sBQWNVtyielhnl7x41Vzg/q0acJU9+BtBKSQiTabB8NUT16wTOeaUuNu8wcG3jre CE0UkvVXVUfpdaLXybxE+GFX9LWmfE3vpsBklcnfVxwatkzaiyMIXePTUQBzNJrnqsoK nSLYHDL9yA/VvXuJKry5dvTMSB3mWkX7VM70zWSkpRsiZkWUbP7OnmlFBCN2KwXbxpPW o+sA== 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=9nV9RJgL5nqXsnEN27udq8GpkpJZtoA2KkXDX+mgAJY=; b=Gah/P8nk688O9Pl/sOaSuKpcJuLo/ABWTrk7NboB6XoUpJy83vksDOweWF31ae1/CS eKIGHVV2BGL6mKgDdUcegfRO6vQw2mT1TOb62jqBz3cx2Dq976fPbPX1s+Fx0P9y0I0G xspEglZUfjjLgpcKphzQwtPfLx+0N1j9Ci18SzUyPPg/F/bBrK0pHlEGxAutptt50WiT h9lEiNLY1pvbzIuIiAkDkZOcfs9sA7wz38DepA/u8q+tA2rM/OQwDgFdChu3PTuS5ife 3JURZX0jyGZlqrpWglr7lSmynplJR0LG0WEnqOpL9p//hq9RhOaBdvF1YcXHvRzU8a10 TuMQ== X-Gm-Message-State: AOAM531L5KpmzTRBbD2QtPRx5nf1ktL8RLja2fzZQ8ETbon6a8xmAiMX Od7qlTUoI0VvbJzFNRF37aoeECCx/3p9hLwN84Y7Dpc7 X-Received: by 2002:a25:c4c5:: with SMTP id u188mr400676ybf.425.1618441098570; Wed, 14 Apr 2021 15:58:18 -0700 (PDT) MIME-Version: 1.0 References: <20210412153754.235500-1-revest@chromium.org> <20210412153754.235500-4-revest@chromium.org> In-Reply-To: From: Andrii Nakryiko Date: Wed, 14 Apr 2021 15:58:07 -0700 Message-ID: Subject: Re: [PATCH bpf-next v3 3/6] bpf: Add a bpf_snprintf helper To: Florent Revest Cc: Geert Uytterhoeven , bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Yonghong Song , KP Singh , Brendan Jackman , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 14, 2021 at 11:30 AM Florent Revest wrote: > > Hey Geert! :) > > On Wed, Apr 14, 2021 at 8:02 PM Geert Uytterhoeven wrote: > > On Wed, Apr 14, 2021 at 9:41 AM Andrii Nakryiko > > wrote: > > > On Mon, Apr 12, 2021 at 8:38 AM Florent Revest wrote: > > > > + fmt = (char *)fmt_addr + fmt_map_off; > > > > + > > > > > > bot complained about lack of (long) cast before fmt_addr, please address > > > > (uintptr_t), I assume? > > (uintptr_t) seems more correct to me as well. However, I just had a > look at the rest of verifier.c and (long) casts are already used > pretty much everywhere whereas uintptr_t isn't used yet. > I'll send a v4 with a long cast for the sake of consistency with the > rest of the verifier. right, I don't care about long or uintptr_t, both are guaranteed to work, I just remember seeing a lot of code with (long) cast. I have no preference.