lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0e3bd726-f0d8-4e50-832f-5a341486632f@linux.dev>
Date: Tue, 18 Mar 2025 23:20:06 +0800
From: Tao Chen <chen.dylane@...ux.dev>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>,
 Jiri Olsa <olsajiri@...il.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
 Daniel Borkmann <daniel@...earbox.net>, Andrii Nakryiko <andrii@...nel.org>,
 Martin KaFai Lau <martin.lau@...ux.dev>, Eddy Z <eddyz87@...il.com>,
 Song Liu <song@...nel.org>, Yonghong Song <yonghong.song@...ux.dev>,
 John Fastabend <john.fastabend@...il.com>, KP Singh <kpsingh@...nel.org>,
 Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>,
 Christian Brauner <brauner@...nel.org>, bpf <bpf@...r.kernel.org>,
 LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH bpf-next] bpf: Define bpf_token_show_fdinfo with
 CONFIG_PROC_FS

在 2025/3/18 22:59, Alexei Starovoitov 写道:
> On Tue, Mar 18, 2025 at 2:29 AM Jiri Olsa <olsajiri@...il.com> wrote:
>>
>> On Tue, Mar 18, 2025 at 02:25:57PM +0800, Tao Chen wrote:
>>> 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 <chen.dylane@...ux.dev>
>>> ---
>>>   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;
>>>   }
>>>
>>> +#ifdef CONFIG_PROC_FS
>>>   static void bpf_token_show_fdinfo(struct seq_file *m, struct file *filp)
>>>   {
>>>        struct bpf_token *token = filp->private_data;
>>> @@ -98,6 +99,7 @@ static void bpf_token_show_fdinfo(struct seq_file *m, struct file *filp)
>>>        else
>>>                seq_printf(m, "allowed_attachs:\t0x%llx\n", token->allowed_attachs);
>>>   }
>>> +#endif
>>>
>>>   #define BPF_TOKEN_INODE_NAME "bpf-token"
>>>
>>> @@ -105,7 +107,9 @@ static const struct inode_operations bpf_token_iops = { };
>>>
>>>   static const struct file_operations bpf_token_fops = {
>>>        .release        = bpf_token_release,
>>> +#ifdef CONFIG_PROC_FS
>>>        .show_fdinfo    = bpf_token_show_fdinfo,
>>> +#endif
>>
>> there's many more of such cases.. I'm not sure if it makes sense to fix that,
>> because it does not break the build and only save space for !CONFIG_PROC_FS
>> kernels
> 
> +1.
> let's keep the code as-is.
> 

Got it, thanks anyway.

> pw-bot: cr


-- 
Best Regards
Tao Chen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ