Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4313048pxb; Mon, 25 Oct 2021 01:38:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8P3HFVnJ5JvBM7yC8V70b/UJbJlJapQbUiKAXJ4XAk4UYGhZCVWNz0nUKmkwmMSp/vwah X-Received: by 2002:a17:90b:2246:: with SMTP id hk6mr34888920pjb.116.1635151089387; Mon, 25 Oct 2021 01:38:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635151089; cv=none; d=google.com; s=arc-20160816; b=FxAG3fgkzn64STD2/PCEt0hnGL05wkWKdtzgPOvVRq0Yaewnv/DaEgDqedGQcow6/l zkXDl5HRbIWVz4RhhATIVmzbHhWw3TZe/ayD53Q43zyOK0TCdmBb95nAHL5KeI1Fh/7y pnSWk55tvPNUJhW+beCztMHkKBFLczKvNK11dS/aI4iYIyJCRq97b4vqCNdoVz3cmVTP jJB2TX0ZmV8Z2OHtncuJ4JQ1PGPLTbZlRsp05QS3Q3xtoZdJKIoizlyZ5i1Z9+ltAIDx cSnAeEAnUwaOJUOVFn17FdaVteVxDimTMXCTY7umo7aVOThj0PBz+IfjC+fgwV71MoIi A5gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TS8muz6Ak9DGU3l2L96V+UecMUYveGNsphx64n4dYOI=; b=sXW3ELlulNfL027NHBOu2iWiz8VzIrxWe87TlcyYzs4owvi/mvchagxJN73+NAdhTB oyAhKG5XFExsO6grjYuw2r7suVBvBXS82IqY4bHJO5SGZiuS9b2pjsM/C8piaESuMESx BmDxfsd+FtjDARrLx0DLs0Skzd1Ho7faCzJnDXWDxNtHYysYApmCQ1AeoIU5FrcWnTIy iKBf51jw6npiZ3PT1lHA9Miov5bTYYhOfs8rzb4zhtcGrvVKKEi4RkFNCLRdz8dwJxAc FUKP3wnNCArxqxiOIjzvaGkRRd2YjK61re0JDEufMsGnL1hnPJ78KJtXzEKuliOAE0BA 86tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=M2FolzUK; 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 j6si2959849pji.151.2021.10.25.01.37.56; Mon, 25 Oct 2021 01:38:09 -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=20210112 header.b=M2FolzUK; 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 S232476AbhJYIg6 (ORCPT + 99 others); Mon, 25 Oct 2021 04:36:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232480AbhJYIg2 (ORCPT ); Mon, 25 Oct 2021 04:36:28 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 762DEC061231; Mon, 25 Oct 2021 01:34:01 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id c4so3517461plg.13; Mon, 25 Oct 2021 01:34:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TS8muz6Ak9DGU3l2L96V+UecMUYveGNsphx64n4dYOI=; b=M2FolzUKrmB9JdFI0MSqy5ChbO8Ja0Pf8UZPZm02u3xFvWDKNyZXc8Dym/hG4NIPAA 4ZpmbwlCuUUeXOEUxchfZH8bRN3iDp6AZUQKd3pXsduzQL8O8nHlQvwfOCN9Flkn1GOl pO4FWJRCWhgdfn+6H0Tj7wfb65dY0IkXl43ypxIQ43r8iOzN5hV9R26R/C7mw0Ba27Os 1WBeZUEUhqNN7swBZp+UXeUn5C/uwh77MU4Emv2Kdba0wtcmAGlRQyFdsd6oKxWfAMOS VWr/1XcWd7zxnJOv7N2ncV8aa37dmE9NYCGJXPzYZC+zOL+03zINlyNRqsvOAw4gqU2o V0Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TS8muz6Ak9DGU3l2L96V+UecMUYveGNsphx64n4dYOI=; b=DGZNIDl+VksXdb0i38MIyjUU1AJwKD8WzuaRgQV/cpBPEisXIYce6Xq7LUKeMiy6pY NfYVwYEq+J0PfKVnbNzkLX6I6eMGcEGi7Bzh/DXn8bjaaEqqOTmhyw0AmQu/pnh1z9u7 gfJRPR7fxFKFREiHHAfMOvFE/aEsvQhkCk9KYUN1Shci3imQy1yR41MdifvSI1sYBBGO zBuZfCzKjs9uvujW2wQdlhjNKtILBJX4w53LKxf9OVHWzCfn0v5qU7gtQmuDmE7AbQXn fg3bOtFOkhu7f5bSuAJSv6uCOtTmAT04tZxg6+O0nqPF/52hHOi7FoTfOwy59mZQUTfl P0ug== X-Gm-Message-State: AOAM531REW7s0EDkk/GrhP67vEoVVCWDvy1CcoFlTv38IKnmtRNfbO74 T8YA1qnnUWU+9UxsiVgTkW8= X-Received: by 2002:a17:90b:4c88:: with SMTP id my8mr18897686pjb.49.1635150841055; Mon, 25 Oct 2021 01:34:01 -0700 (PDT) Received: from localhost.localdomain ([140.82.17.67]) by smtp.gmail.com with ESMTPSA id p13sm2495694pfo.102.2021.10.25.01.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 01:34:00 -0700 (PDT) From: Yafang Shao To: akpm@linux-foundation.org, keescook@chromium.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, arnaldo.melo@gmail.com, pmladek@suse.com, peterz@infradead.org, viro@zeniv.linux.org.uk, valentin.schneider@arm.com, qiang.zhang@windriver.com, robdclark@chromium.org, christian@brauner.io, dietmar.eggemann@arm.com, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, davem@davemloft.net, kuba@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, dennis.dalessandro@cornelisnetworks.com, mike.marciniszyn@cornelisnetworks.com, dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, oliver.sang@intel.com, lkp@intel.com, Yafang Shao , Andrii Nakryiko Subject: [PATCH v6 08/12] tools/bpf/bpftool/skeleton: make it adopt to task comm size change Date: Mon, 25 Oct 2021 08:33:11 +0000 Message-Id: <20211025083315.4752-9-laoar.shao@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211025083315.4752-1-laoar.shao@gmail.com> References: <20211025083315.4752-1-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org bpf_probe_read_kernel_str() will add a nul terminator to the dst, then we don't care about if the dst size is big enough. Signed-off-by: Yafang Shao Cc: Mathieu Desnoyers Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Al Viro Cc: Kees Cook Cc: Petr Mladek --- tools/bpf/bpftool/skeleton/pid_iter.bpf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/bpf/bpftool/skeleton/pid_iter.bpf.c b/tools/bpf/bpftool/skeleton/pid_iter.bpf.c index d9b420972934..f70702fcb224 100644 --- a/tools/bpf/bpftool/skeleton/pid_iter.bpf.c +++ b/tools/bpf/bpftool/skeleton/pid_iter.bpf.c @@ -71,8 +71,8 @@ int iter(struct bpf_iter__task_file *ctx) e.pid = task->tgid; e.id = get_obj_id(file->private_data, obj_type); - bpf_probe_read_kernel(&e.comm, sizeof(e.comm), - task->group_leader->comm); + bpf_probe_read_kernel_str(&e.comm, sizeof(e.comm), + task->group_leader->comm); bpf_seq_write(ctx->meta->seq, &e, sizeof(e)); return 0; -- 2.17.1