* [PATCH net] net: llc: make empty have static storage duration
@ 2026-06-16 6:40 Wentao Guan
2026-06-17 10:50 ` Simon Horman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Wentao Guan @ 2026-06-16 6:40 UTC (permalink / raw)
To: kuba; +Cc: joel.granados, netdev, linux-kernel, zhanjun, niecheng1,
Wentao Guan
Make empty have static storage duration (like net/sysctl_net.c does) to
avoid a potential use-after-return and keep consistent with
__register_sysctl_table @table 'should not be free'd after registration'.
Fixes: 73dbd8cf7947 ("net: Remove ctl_table sentinel elements from several networking subsystems")
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
---
net/llc/sysctl_net_llc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/llc/sysctl_net_llc.c b/net/llc/sysctl_net_llc.c
index c8d88e2508fce..15f1e5d88f208 100644
--- a/net/llc/sysctl_net_llc.c
+++ b/net/llc/sysctl_net_llc.c
@@ -47,7 +47,7 @@ static struct ctl_table_header *llc_station_header;
int __init llc_sysctl_init(void)
{
- struct ctl_table empty[1] = {};
+ static struct ctl_table empty[1] = {};
llc2_timeout_header = register_net_sysctl(&init_net, "net/llc/llc2/timeout", llc2_timeout_table);
llc_station_header = register_net_sysctl_sz(&init_net, "net/llc/station", empty, 0);
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH net] net: llc: make empty have static storage duration
2026-06-16 6:40 [PATCH net] net: llc: make empty have static storage duration Wentao Guan
@ 2026-06-17 10:50 ` Simon Horman
2026-06-19 0:52 ` Jakub Kicinski
2026-06-19 1:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2026-06-17 10:50 UTC (permalink / raw)
To: Wentao Guan; +Cc: kuba, joel.granados, netdev, linux-kernel, zhanjun, niecheng1
On Tue, Jun 16, 2026 at 02:40:53PM +0800, Wentao Guan wrote:
> Make empty have static storage duration (like net/sysctl_net.c does) to
> avoid a potential use-after-return and keep consistent with
> __register_sysctl_table @table 'should not be free'd after registration'.
>
> Fixes: 73dbd8cf7947 ("net: Remove ctl_table sentinel elements from several networking subsystems")
> Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net] net: llc: make empty have static storage duration
2026-06-16 6:40 [PATCH net] net: llc: make empty have static storage duration Wentao Guan
2026-06-17 10:50 ` Simon Horman
@ 2026-06-19 0:52 ` Jakub Kicinski
2026-06-19 1:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2026-06-19 0:52 UTC (permalink / raw)
To: Wentao Guan; +Cc: joel.granados, netdev, linux-kernel, zhanjun, niecheng1
On Tue, 16 Jun 2026 14:40:53 +0800 Wentao Guan wrote:
> Make empty have static storage duration (like net/sysctl_net.c does) to
> avoid a potential use-after-return and keep consistent with
> __register_sysctl_table @table 'should not be free'd after registration'.
>
> Fixes: 73dbd8cf7947 ("net: Remove ctl_table sentinel elements from several networking subsystems")
> Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
> ---
> net/llc/sysctl_net_llc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/llc/sysctl_net_llc.c b/net/llc/sysctl_net_llc.c
> index c8d88e2508fce..15f1e5d88f208 100644
> --- a/net/llc/sysctl_net_llc.c
> +++ b/net/llc/sysctl_net_llc.c
> @@ -47,7 +47,7 @@ static struct ctl_table_header *llc_station_header;
>
> int __init llc_sysctl_init(void)
> {
> - struct ctl_table empty[1] = {};
> + static struct ctl_table empty[1] = {};
> llc2_timeout_header = register_net_sysctl(&init_net, "net/llc/llc2/timeout", llc2_timeout_table);
> llc_station_header = register_net_sysctl_sz(&init_net, "net/llc/station", empty, 0);
I will apply this but it's not a bug.
The size is 0, even tho the pointer is stored there can be no access.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net] net: llc: make empty have static storage duration
2026-06-16 6:40 [PATCH net] net: llc: make empty have static storage duration Wentao Guan
2026-06-17 10:50 ` Simon Horman
2026-06-19 0:52 ` Jakub Kicinski
@ 2026-06-19 1:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-06-19 1:00 UTC (permalink / raw)
To: Wentao Guan; +Cc: kuba, joel.granados, netdev, linux-kernel, zhanjun, niecheng1
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 16 Jun 2026 14:40:53 +0800 you wrote:
> Make empty have static storage duration (like net/sysctl_net.c does) to
> avoid a potential use-after-return and keep consistent with
> __register_sysctl_table @table 'should not be free'd after registration'.
>
> Fixes: 73dbd8cf7947 ("net: Remove ctl_table sentinel elements from several networking subsystems")
> Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
>
> [...]
Here is the summary with links:
- [net] net: llc: make empty have static storage duration
https://git.kernel.org/netdev/net/c/d31deeab707b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-06-19 1:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-16 6:40 [PATCH net] net: llc: make empty have static storage duration Wentao Guan
2026-06-17 10:50 ` Simon Horman
2026-06-19 0:52 ` Jakub Kicinski
2026-06-19 1:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox