From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jia-Ju Bai Subject: [BUG] net: e100: possible data races in e100_watchdog() Date: Wed, 27 Jun 2018 09:30:51 +0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, Linux Kernel Mailing List To: jeffrey.t.kirsher@intel.com, jchapman@katalix.com Return-path: Received: from mail-pl0-f45.google.com ([209.85.160.45]:34604 "EHLO mail-pl0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751121AbeF0Bb0 (ORCPT ); Tue, 26 Jun 2018 21:31:26 -0400 Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: The call paths in Linux 4.16.7 that may raise data races are: CPU0: e100_set_multicast_list e100_exec_cb line 879: spin_lock_irqsave() e100_configure line 1139: nic->flags [READ] line 1148: nic->flags [READ] CPU1: e100_watchdog: line 1758, 1756: nic->flags [WRITE] The READ operations in CPU0 are performed with holding a spinlock (line 879), but the WRITE operation in CPU1 is performed without holding this spinlock, so it may cause data races here. A possible fix is to add spin_lock_irqsave() in e100_watchdog(). I am not sure that whether this possible fix is correct, so I only report the data races. Best wishes, Jia-Ju Bai