[PATCH RESEND v2 30/51] net: pktgen: reject device names with a '/'

sashiko-bot at kernel.org sashiko-bot at kernel.org
Thu Nov 5 11:29:47 PST 2026


> "add_device" takes a name like eth0 at 1. Only the part in front of the
> '@' has to name a network device. The rest is free text and all of it
> becomes the name of a file in /proc/net/pktgen, where procfs takes a
> '/' as a directory separator. So "add_device lo at a/b" makes procfs look
> for a directory "lo at a" that doesn't exist and warn about it. Any user
> can do that in a network namespace of its own:
> 
>   name 'lo at a/b'
>   WARNING: fs/proc/generic.c:174 at __xlate_proc_name+0xb1/0xf0, CPU#3: bash/241
>   Call Trace:
>    __proc_create+0xd0/0x9b0
>    proc_create_reg+0x45/0xf0
>    proc_create_data+0x77/0xf0
>    pktgen_thread_write+0xd8d/0x1750
> 
> With panic_on_warn that takes the machine down. And if "lo at a" exists
> because somebody added a device of that name, procfs used to register
> the new entry below that regular file, and removing "lo at a" freed both.
> 
> Reject names with a '/'.
> 
> Reported-by: Chris Mason <mason at kernel.org>
> Fixes: e6fce5b916cd ("pktgen: multiqueue etc.")
> Cc: stable at vger.kernel.org
> Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261104-work-procfs-bugfixes-v2-0-021c84d852e0@kernel.org?part=30




More information about the kexec mailing list