Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1288467rwl; Thu, 5 Jan 2023 11:16:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXuWeJD+r+jY1vHjSoWZ1XgV4htXLDG/B6KeTTWLTHc/Uf5ebhK4c5rvd1MpmU4tNnerok0m X-Received: by 2002:aa7:d689:0:b0:461:8a19:414f with SMTP id d9-20020aa7d689000000b004618a19414fmr43570243edr.36.1672946193060; Thu, 05 Jan 2023 11:16:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672946193; cv=none; d=google.com; s=arc-20160816; b=KgIVHDqcSHgWokvOLGCaFgNPXQL8/cN1sV3EFbFUapIRD17WWV0SJZEjcVIivUP1PT 8Iv0P1oZzrqLH6tbINEjg3W42IHbPFGVf/rvNlNXodIPfd5/sBvT8i2uzHjdJbNo66rn RkjMra312LP+nlp9dSjC8rLUDI+KLVdrYaa65jHnTMrteBYY4ENBvMdit1ZUQySz5an/ Wm+jhUY3eITVp30zWOk/UaP9tg7KaJj/J87E61IQl6lwZQPey4L0ZqUnh6tbvZslCmlD 5eWgm78P+TYraeWu6261R0NZdsZccH3skhk9iyCk8aIW/CToYAHbvdF7st7Pf2HW9ZGc ggKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=XZuxdDBhTxtm3sl01imrqslWnx2DLyZq2pIBjdBkdtU=; b=cEpa4YLwNdtz7mOh8npYXzYlRWpIWGPNr9aNdGewORhGaarGos1ttw5yw+QSP7aK7c da+7OddQmJ7/tXanltTnS4OTeuvDNowCLFcIPbkwnYfcT3W1LqfKVN2u4EirVHVA3w9F SsmuJa87DeoZpX2SEonhsIQhnfY2x81qTERgcAZ1E8UeY67hybxysAPjJPXSSuNFuUH6 MR15rXZL1K+4OyzM/h6BOO+teCr/42orHEc1Z+UbVbZ0nWyn6MUNAvtAZ54P1Psvpi/2 dFz8/FEye3goDqFegRKB1GZiKhIPXF9ryT8c7edMmKHBEyct2n2en+Bj6QRP8j7VXktv ZNZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=nY1jnv1a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q9-20020a056402032900b004782d6db359si28879056edw.146.2023.01.05.11.16.19; Thu, 05 Jan 2023 11:16:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=nY1jnv1a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S235166AbjAESre (ORCPT + 55 others); Thu, 5 Jan 2023 13:47:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234999AbjAESrS (ORCPT ); Thu, 5 Jan 2023 13:47:18 -0500 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22C345B14E for ; Thu, 5 Jan 2023 10:47:18 -0800 (PST) Received: by mail-pg1-x549.google.com with SMTP id 191-20020a6306c8000000b0049699771579so15089356pgg.3 for ; Thu, 05 Jan 2023 10:47:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=XZuxdDBhTxtm3sl01imrqslWnx2DLyZq2pIBjdBkdtU=; b=nY1jnv1a32uBxDuO5+tT8LwT5b7tNeasNcDHqg25ZhhkWQ8KBl5tFYwf+6r4Nznw+h lWkcpWmx5MFR8d+EI05kIZMWbRY7bn6zJUDb7EieF6hCh39MVswYSoxbGCwXeDcwMW5u Ffv8qRwoxYu59pRGqDELmVYlWbiPzRORv5UiTPHlzdMXPXQhI/vNKxIHh7zzFOBg8jEw 7GHDEdXlsJ+RylQfGe/oCNQzy5JBRdHpu0JX8PdHXEzSv0stkVYMRPkzBjv7Uhw9W0iN vKeBbZOe6t3+1Yu3AUNhY7XVIZmi4/pZfdm+JtclSKFOep8FmdbKqhrxD/LzYYJCia16 Y5FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XZuxdDBhTxtm3sl01imrqslWnx2DLyZq2pIBjdBkdtU=; b=F8IerA98v6bGfwtOt8LJYnhASdKYMm/L5z5l4+UOUVcleOep98U7MS9bdLUC4z1KU9 wfrlkvnPj81/KFo6llbFvLV4P5QT9xfRkvUPJMzHI4RRBK2fqasI0EnXFIOasXhACvG3 F4dEDRUOWiI6gP9n58HYrRW/Nx9QwDhZ5+KL7wlcVonV1HVhREnfPDxS+KEkOSIO4dT4 GkrTeN/jAWcQ2CNYFaV9N/X3EreFuse0lYBsC+9ohmtZzVbMJTzYsrHpfe5Fvcwl1N49 LJC4NWe50WUbuSvMJKLMT8+9OOt2qU5w+fYyayPB54Kaeld1efqaQzjE7I9nP1x+dbML bPyA== X-Gm-Message-State: AFqh2kq7MafjbeO0eILVPxPo3eMf4u1N3vQDDaMcG9nKlAaGjeZAS55Q mf1GIe1IngKQQ9w/5tYqoIY0L50= X-Received: from sdf.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5935]) (user=sdf job=sendgmr) by 2002:a17:903:40c8:b0:189:7a15:134b with SMTP id t8-20020a17090340c800b001897a15134bmr2760642pld.143.1672944437584; Thu, 05 Jan 2023 10:47:17 -0800 (PST) Date: Thu, 5 Jan 2023 10:47:15 -0800 In-Reply-To: Mime-Version: 1.0 References: Message-ID: Subject: Re: [PATCH bpf-next] libbpf: poison strlcpy() From: sdf@google.com To: Rong Tao Cc: andrii@kernel.org, rongtao@cestc.cn, Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Hao Luo , Jiri Olsa , "open list:BPF [LIBRARY] (libbpf)" , open list Content-Type: text/plain; charset="UTF-8"; format=flowed; delsp=yes X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/05, Rong Tao wrote: > From: Rong Tao > Since commit 9fc205b413b3("libbpf: Add sane strncpy alternative and use > it internally") introduce libbpf_strlcpy(), thus add strlcpy() to a poison > list to prevent accidental use of it. > Signed-off-by: Rong Tao Acked-by: Stanislav Fomichev > --- > tools/lib/bpf/libbpf_internal.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > diff --git a/tools/lib/bpf/libbpf_internal.h > b/tools/lib/bpf/libbpf_internal.h > index 377642ff51fc..2d26ded383ca 100644 > --- a/tools/lib/bpf/libbpf_internal.h > +++ b/tools/lib/bpf/libbpf_internal.h > @@ -20,8 +20,8 @@ > /* make sure libbpf doesn't use kernel-only integer typedefs */ > #pragma GCC poison u8 u16 u32 u64 s8 s16 s32 s64 > -/* prevent accidental re-addition of reallocarray() */ > -#pragma GCC poison reallocarray > +/* prevent accidental re-addition of reallocarray()/strlcpy() */ > +#pragma GCC poison reallocarray strlcpy > #include "libbpf.h" > #include "btf.h" > -- > 2.39.0