From patchwork Thu Jan 5 14:36:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rong Tao X-Patchwork-Id: 13090022 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDB37C3DA7A for ; Thu, 5 Jan 2023 14:37:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232069AbjAEOhx (ORCPT ); Thu, 5 Jan 2023 09:37:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjAEOhw (ORCPT ); Thu, 5 Jan 2023 09:37:52 -0500 X-Greylist: delayed 68 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 05 Jan 2023 06:37:49 PST Received: from out203-205-221-209.mail.qq.com (out203-205-221-209.mail.qq.com [203.205.221.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFD4359337; Thu, 5 Jan 2023 06:37:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1672929467; bh=3tPdRO47uzjqDz/kcaWbYMUahaQxKcrA7demosetVcM=; h=From:To:Cc:Subject:Date; b=Nytg0sCgJ9JBlCaoTuZwG3RHCB72oHHlHRpcNieOLjkD5nzP79pz/NFihnB4r75s8 2c9GOhZ27bMWWMIwtENz4TPd607x4hKzfYWRPEr4KcHp+nEeuYMitIy6eHkXWyR3UW u36yft5+MkqPk9FLh+qsBC1AkOdXfK8SuJGgeBRw= Received: from rtoax.. ([111.199.188.149]) by newxmesmtplogicsvrszb1-0.qq.com (NewEsmtp) with SMTP id 92383400;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+vAW2tWtW2 From: Rong Tao To: andrii@kernel.org Cc: rongtao@cestc.cn, Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf@vger.kernel.org (open list:BPF [LIBRARY] (libbpf)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH bpf-next] libbpf: poison strlcpy() Date: Thu, 5 Jan 2023 22:36:33 +0800 X-OQ-MSGID: <20230105143634.119201-1-rtoax@foxmail.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net 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"