Race over table->data in proc_do_sync_threshold()

Sishuai Gong <[email protected]>
Newsgroups org.kernel.vger.lvs-devel,org.kernel.vger.netdev
Message-ID <[email protected]>
Hi,

We observed races over (struct ctl_table *) table->data when two threads
are running proc_do_sync_threshold() in parallel, as shown below:

Thread-1			Thread-2
memcpy(val, valp, sizeof(val)); memcpy(valp, val, sizeof(val));

This race probably would mess up table->data. Is it better to add a lock?

Thanks
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.