mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-27 12:59:07 -04:00
net: Const qualify ctl_tables that kmemdup unconditionally
Const qualify clt_table arrays in the net directory that always pass a memory duplicate to sysctl register. The template would then be in .rodata and the kmemdup'ed array would be outside. Signed-off-by: Joel Granados <joel.granados@kernel.org> Link: https://patch.msgid.link/20260810-jag-net_const_qualify-v4-2-77e888237c69@kernel.org Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
committed by
Paolo Abeni
parent
ef6cb145e2
commit
09190c59cd
@@ -2796,7 +2796,7 @@ static void devinet_sysctl_unregister(struct in_device *idev)
|
||||
neigh_sysctl_unregister(idev->arp_parms);
|
||||
}
|
||||
|
||||
static struct ctl_table ctl_forward_entry[] = {
|
||||
static const struct ctl_table ctl_forward_entry[] = {
|
||||
{
|
||||
.procname = "ip_forward",
|
||||
.data = &ipv4_devconf.data[
|
||||
|
||||
@@ -1374,7 +1374,7 @@ EXPORT_SYMBOL(icmpv6_err_convert);
|
||||
static u32 icmpv6_errors_extension_mask_all =
|
||||
GENMASK_U8(ICMP_ERR_EXT_COUNT - 1, 0);
|
||||
|
||||
static struct ctl_table ipv6_icmp_table_template[] = {
|
||||
static const struct ctl_table ipv6_icmp_table_template[] = {
|
||||
{
|
||||
.procname = "ratelimit",
|
||||
.data = &init_net.ipv6.sysctl.icmpv6_time,
|
||||
|
||||
@@ -6590,7 +6590,7 @@ static int ipv6_sysctl_rtcache_flush(const struct ctl_table *ctl, int write,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct ctl_table ipv6_route_table_template[] = {
|
||||
static const struct ctl_table ipv6_route_table_template[] = {
|
||||
{
|
||||
.procname = "max_size",
|
||||
.data = &init_net.ipv6.sysctl.ip6_rt_max_size,
|
||||
|
||||
@@ -61,7 +61,7 @@ proc_rt6_multipath_hash_fields(const struct ctl_table *table, int write, void *b
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct ctl_table ipv6_table_template[] = {
|
||||
static const struct ctl_table ipv6_table_template[] = {
|
||||
{
|
||||
.procname = "bindv6only",
|
||||
.data = &init_net.ipv6.sysctl.bindv6only,
|
||||
|
||||
@@ -639,7 +639,7 @@ enum nf_ct_sysctl_index {
|
||||
NF_SYSCTL_CT_LAST_SYSCTL,
|
||||
};
|
||||
|
||||
static struct ctl_table nf_ct_sysctl_table[] = {
|
||||
static const struct ctl_table nf_ct_sysctl_table[] = {
|
||||
[NF_SYSCTL_CT_MAX] = {
|
||||
.procname = "nf_conntrack_max",
|
||||
.data = &nf_conntrack_max,
|
||||
|
||||
@@ -92,7 +92,7 @@ static struct ctl_table sctp_table[] = {
|
||||
#define SCTP_PF_RETRANS_IDX 2
|
||||
#define SCTP_PS_RETRANS_IDX 3
|
||||
|
||||
static struct ctl_table sctp_net_table[] = {
|
||||
static const struct ctl_table sctp_net_table[] = {
|
||||
[SCTP_RTO_MIN_IDX] = {
|
||||
.procname = "rto_min",
|
||||
.data = &init_net.sctp.rto_min,
|
||||
|
||||
@@ -13,7 +13,7 @@ static void __net_init __xfrm_sysctl_init(struct net *net)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
static struct ctl_table xfrm_table[] = {
|
||||
static const struct ctl_table xfrm_table[] = {
|
||||
{
|
||||
.procname = "xfrm_aevent_etime",
|
||||
.maxlen = sizeof(u32),
|
||||
|
||||
Reference in New Issue
Block a user