]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: sysctl: allow dump_cpumask to handle higher numbers of CPUs
authorAntoine Tenart <atenart@kernel.org>
Thu, 17 Oct 2024 15:24:19 +0000 (17:24 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Wed, 23 Oct 2024 08:28:26 +0000 (10:28 +0200)
commit124afe773b1ad6cddb8f661a14a32c9e76ca92a6
tree0df1a4a2b72ef3190e88744493933b2e9e123928
parenta8cc8fa14541d6f8f1fbe78607a096e97c80179e
net: sysctl: allow dump_cpumask to handle higher numbers of CPUs

This fixes the output of rps_default_mask and flow_limit_cpu_bitmap when
the CPU count is > 448, as it was truncated.

The underlying values are actually stored correctly when writing to
these sysctl but displaying them uses a fixed length temporary buffer in
dump_cpumask. This buffer can be too small if the CPU count is > 448.

Fix this by dynamically allocating the buffer in dump_cpumask, using a
guesstimate of what we need.

Signed-off-by: Antoine Tenart <atenart@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/core/sysctl_net_core.c