mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
559d4c6a9d
The test if a table is a permanently empty one, inspects the address of the registered ctl_table argument. However as sysctl_mount_point is an empty array and does not occupy and space it can end up sharing an address with another object in memory. If that other object itself is a "struct ctl_table" then registering that table will fail as it's incorrectly recognized as permanently empty. Avoid this issue by adding a dummy element to the array so that is not empty anymore. Explicitly register the table with zero elements as otherwise the dummy element would be recognized as a sentinel element which would lead to a runtime warning from the sysctl core. While the issue seems not being encountered at this time, this seems mostly to be due to luck. Also a future change, constifying sysctl_mount_point and root_table, can reliably trigger this issue on clang 18. Given that empty arrays are non-standard in the first place it seems prudent to avoid them if possible. Fixes: |
||
---|---|---|
.. | ||
array.c | ||
base.c | ||
bootconfig.c | ||
cmdline.c | ||
consoles.c | ||
cpuinfo.c | ||
devices.c | ||
fd.c | ||
fd.h | ||
generic.c | ||
inode.c | ||
internal.h | ||
interrupts.c | ||
Kconfig | ||
kcore.c | ||
kmsg.c | ||
loadavg.c | ||
Makefile | ||
meminfo.c | ||
namespaces.c | ||
nommu.c | ||
page.c | ||
proc_net.c | ||
proc_sysctl.c | ||
proc_tty.c | ||
root.c | ||
self.c | ||
softirqs.c | ||
stat.c | ||
task_mmu.c | ||
task_nommu.c | ||
thread_self.c | ||
uptime.c | ||
util.c | ||
version.c | ||
vmcore.c |