[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230810022734.47246-1-kuniyu@amazon.com>
Date: Wed, 9 Aug 2023 19:27:34 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <sishuai.system@...il.com>
CC: <horms@...ge.net.au>, <ja@....bg>, <lvs-devel@...r.kernel.org>,
<netdev@...r.kernel.org>, <kuniyu@...zon.com>
Subject: Re: Race over table->data in proc_do_sync_threshold()
From: Sishuai Gong <sishuai.system@...il.com>
Date: Wed, 9 Aug 2023 20:30:37 -0400
> 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?
Yes, we should acquire mutex/seqlock etc.
Powered by blists - more mailing lists