hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/net/netfilter/ipvs/ip_vs_ctl.c
....@@ -1802,6 +1802,7 @@
18021802 proc_do_sync_threshold(struct ctl_table *table, int write,
18031803 void *buffer, size_t *lenp, loff_t *ppos)
18041804 {
1805
+ struct netns_ipvs *ipvs = table->extra2;
18051806 int *valp = table->data;
18061807 int val[2];
18071808 int rc;
....@@ -1811,6 +1812,7 @@
18111812 .mode = table->mode,
18121813 };
18131814
1815
+ mutex_lock(&ipvs->sync_mutex);
18141816 memcpy(val, valp, sizeof(val));
18151817 rc = proc_dointvec(&tmp, write, buffer, lenp, ppos);
18161818 if (write) {
....@@ -1820,6 +1822,7 @@
18201822 else
18211823 memcpy(valp, val, sizeof(val));
18221824 }
1825
+ mutex_unlock(&ipvs->sync_mutex);
18231826 return rc;
18241827 }
18251828
....@@ -4077,6 +4080,7 @@
40774080 ipvs->sysctl_sync_threshold[0] = DEFAULT_SYNC_THRESHOLD;
40784081 ipvs->sysctl_sync_threshold[1] = DEFAULT_SYNC_PERIOD;
40794082 tbl[idx].data = &ipvs->sysctl_sync_threshold;
4083
+ tbl[idx].extra2 = ipvs;
40804084 tbl[idx++].maxlen = sizeof(ipvs->sysctl_sync_threshold);
40814085 ipvs->sysctl_sync_refresh_period = DEFAULT_SYNC_REFRESH_PERIOD;
40824086 tbl[idx++].data = &ipvs->sysctl_sync_refresh_period;