Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5828235imm; Tue, 26 Jun 2018 19:45:04 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLsZIPN6STFnoumTZ6+q7idNDj+4wkGdhkD1CyoJWjeIMZsPSLamu/CdfZaYjaPWlOx2mfr X-Received: by 2002:a17:902:bd42:: with SMTP id b2-v6mr4142888plx.23.1530067504788; Tue, 26 Jun 2018 19:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530067504; cv=none; d=google.com; s=arc-20160816; b=KSQMDjRDUGMIP2HsIhS/c5V03r6+kTjZJcHYqsODxoi0BQGeFMfWmXld9ZeEVvGjCy 2ynqfVcvTX1g2LqrAanmwq6o4UylO/CFgsek3ihSC9MOcahQhKWW8fzcZm+8ID0FHzLD 1Au69yZJ0BNywrecMc7LRXw0Sn1BgwSENtFCXJQe4xrVDqFn7GhvRx35izYFnHyuYNt9 a75t20Zb/5EJcsEIZThO2cfvjVDlq0CPQYJaHeqTNkce2jCF7uaOMf32uxE04WGXb3Et uxh/ABAk8YeTTJMK8LhiUpsQ3Xk2d+4IYVpIDGAzkGupQiAr+1YKPTaKaZOL8FTz7SE7 OGXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:mime-version:user-agent:date:message-id :cc:to:subject:from:dkim-signature:arc-authentication-results; bh=JmMqhdSGdNRzaNiXIr1WCriQw0BHGB7OYLS7BIIUa84=; b=WY9dVVXHXm93zD+BxaAmUovQlB3kfuHH9pBNlJMkjrKHscmsje6iVnRv8MmYhhaKJn PIoKwLhtXE7tbUvOEJvF82araWQhAkZgRM6dRJ87VeXMUw0aiBSE5bGmYAS2Sa4q3jqE blVPgKIicYKSeJRjcNuMOZsyVhDs3ME2+jhW5d6cQAgQxV2rw8fwwOXouNbjOYpDziP2 p985UVe3nyxNv4INqa1vMqIjgoR44YVgFDbfd9jdZ0VdXNeITxp8PjzuwnClZKkwfjnY QNpQhUAqvYWvTioRABpBHYYQMHYwNDgoMudxErZ8jhQx5Di0EVh+o3C2L1p1/AAL50P7 fPpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TNvfXi+z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97-v6si2905658pld.345.2018.06.26.19.44.49; Tue, 26 Jun 2018 19:45:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TNvfXi+z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755333AbeF0Bba (ORCPT + 99 others); Tue, 26 Jun 2018 21:31:30 -0400 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 Received: by mail-pl0-f45.google.com with SMTP id z9-v6so210190plo.1; Tue, 26 Jun 2018 18:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=JmMqhdSGdNRzaNiXIr1WCriQw0BHGB7OYLS7BIIUa84=; b=TNvfXi+zyJbwIG32I65Rlca9EN0sA5jeprr61b0fRo64JjA3dqKKKjBUbTyuwyIqle 3NeK+KfzBwJ2j7uFYHjqzOIxZxaH2oohvp243L6pAH/0hXMOhXP+iPz1X5id5W3Yi5fP aJx6G9dOeH91JF12UtbeixwsQQ7d3aseBawheebu2FFxEFRm/vTkZtZUD3gj+/MG07+X wzcApIJ9JUYqh07wfLaVAMP4eTz5kYksJ2vaVMsJaTHos+79P6I8AuGqI36hdTz84eiw GgWnBTCDvU3WDIuLqVV/DV8FkFbeHFd3fGQo8bBo8ZFjDWviKVu/j7OENbbj2N4Zxnfj wLOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=JmMqhdSGdNRzaNiXIr1WCriQw0BHGB7OYLS7BIIUa84=; b=UzaBm9w/ydWMtYUuojxJwCtQMRlcUhJYH6bGc/VbJPJX+TB2ZSf0Sp6zDYxX+AtYC3 xpxsNLrAAAyrUd86pEyCn9+bgO8RXYTbYYakZwvZ0V+3cOm1Pqq9LDzSG9/4YDmelWAd hIo4C0+8rL22dIePVRRYWyokJPN+mGsK2AeI0kSYUhjyAd4s6ZZMjx5OdpGWslhBLTmo cGDskSL5Vb8dOrGzD9Zk/JmoaFbY5HsTsrL1D6zjWZTBhi/JQwCQPzXLSeoqUM4z1vt5 +1KYCsqzuHPNOckNWCSdGwSdu/b1GDm+IXm00mEVgcsSP/x5+PcR75XzcJda9PQnbqWe w7nQ== X-Gm-Message-State: APt69E0bfjbVHZbLjHC6tqek5OEv6zvrgYBFyYUUgdNc9ZHuS/PAcyK7 JLBCWtBfNdxxSVB8lzeCXr0iq70j X-Received: by 2002:a17:902:7891:: with SMTP id q17-v6mr4003596pll.186.1530063086038; Tue, 26 Jun 2018 18:31:26 -0700 (PDT) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.70.42? ([2402:f000:1:1501:200:5efe:a66f:462a]) by smtp.gmail.com with ESMTPSA id p12-v6sm4697477pfi.175.2018.06.26.18.31.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 18:31:25 -0700 (PDT) From: Jia-Ju Bai Subject: [BUG] net: e100: possible data races in e100_watchdog() To: jeffrey.t.kirsher@intel.com, jchapman@katalix.com Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, Linux Kernel Mailing List Message-ID: Date: Wed, 27 Jun 2018 09:30:51 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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