From nobody Wed Dec 17 12:03:45 2025 Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3B0A1B85D1 for ; Tue, 18 Mar 2025 06:26:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742279171; cv=none; b=F/GVEq0uOZMi++01PktcB7IqMdubqESEMSCT4UmJ/sfHtaokaaL/M1UTPJneLbB4n1PoJkkatLNYd6F+YGzA6k2QjLLfhVoTFuitBkITsB+uxusHTbCDcF0BAsji5DKcYyKILOaPi729fLU5PppH1H31C28iflvaW7V4OJl7/wE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742279171; c=relaxed/simple; bh=QVQrDH1hlAa+TcHIQoHQD7uOP+VwNzlqveun99yp7GU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=OPuZ+q8g3V3sdFlaUBnf3gd2/GCSY231HiaeUEXcg8amp0xtiBNcvUlwvWnAk6si2FR4crCp73geNzJNJt67fiWk94tTVXr0d7W3DHWdON1IcVaz+QGXk+tgsEZWx8M3QZOzA95zRLB/MDQHvOUkM24NhLjrkpC3StEMl94o2WM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=OVL5rrZK; arc=none smtp.client-ip=95.215.58.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="OVL5rrZK" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1742279165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=PXMMkhBcIWUZV4hOQTzv/pwmFi5A7eckeNFl/KW0KbY=; b=OVL5rrZKo1IHB5HIsnKz5PqW/eOM6nE1KeXIryhfIdfLLyQ24HBPda/1/lcjy2uRFjVw/k gRemcyxJhTqZJGs5OEx3XeBS/JveYqXKniC4PNq6aR5hfYdF7hpy98/2vRDDz/hjizcoLC XR9W5myPcTxnh0mpBD7uC0ggUeoUeNg= From: Tao Chen To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com, jolsa@kernel.org, brauner@kernel.org Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Tao Chen Subject: [PATCH bpf-next] bpf: Define bpf_token_show_fdinfo with CONFIG_PROC_FS Date: Tue, 18 Mar 2025 14:25:57 +0800 Message-Id: <20250318062557.3001333-1-chen.dylane@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Protect bpf_token_show_fdinfo with CONFIG_PROC_FS check, follow the pattern used with other *_show_fdinfo functions. Fixes: 35f96de04127 ("bpf: Introduce BPF token object") Signed-off-by: Tao Chen --- kernel/bpf/token.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/bpf/token.c b/kernel/bpf/token.c index 26057aa13..104ca37e9 100644 --- a/kernel/bpf/token.c +++ b/kernel/bpf/token.c @@ -65,6 +65,7 @@ static int bpf_token_release(struct inode *inode, struct = file *filp) return 0; } =20 +#ifdef CONFIG_PROC_FS static void bpf_token_show_fdinfo(struct seq_file *m, struct file *filp) { struct bpf_token *token =3D filp->private_data; @@ -98,6 +99,7 @@ static void bpf_token_show_fdinfo(struct seq_file *m, str= uct file *filp) else seq_printf(m, "allowed_attachs:\t0x%llx\n", token->allowed_attachs); } +#endif =20 #define BPF_TOKEN_INODE_NAME "bpf-token" =20 @@ -105,7 +107,9 @@ static const struct inode_operations bpf_token_iops =3D= { }; =20 static const struct file_operations bpf_token_fops =3D { .release =3D bpf_token_release, +#ifdef CONFIG_PROC_FS .show_fdinfo =3D bpf_token_show_fdinfo, +#endif }; =20 int bpf_token_create(union bpf_attr *attr) --=20 2.43.0