LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jia-Ju Bai <baijiaju1990@gmail.com>,
	davem@davemloft.net, fthain@telegraphics.com.au, joe@perches.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: 8390: Fix possible data races in __ei_get_stats
Date: Mon, 7 May 2018 22:04:51 -0700	[thread overview]
Message-ID: <dddbec3f-4b63-3e70-d857-4980135d6f31@gmail.com> (raw)
In-Reply-To: <6fe51782-2169-53c8-9bac-1715262e716d@gmail.com>



On 05/07/2018 07:16 PM, Jia-Ju Bai wrote:

> Yes, "&dev->stats" will not change, because it is a fixed address.
> But the field data in "dev->stats" is changed (rx_frame_errors, rx_crc_errors and rx_missed_errors).
> So if the driver returns "&dev->stats" without lock protection (like on line 858), the field data value of this return value can be the changed field data value or unchanged field data value.


We do not care.

This function can be called by multiple cpus at the same time.

As soon as one cpu returns from it, another cpu can happily modify dev->stats.ANYFIELD.

Your patch fixes nothing at all.

  reply	other threads:[~2018-05-08  5:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-07 14:08 Jia-Ju Bai
2018-05-07 14:15 ` Eric Dumazet
2018-05-08  0:51   ` Jia-Ju Bai
2018-05-08  1:56     ` Eric Dumazet
2018-05-08  2:16       ` Jia-Ju Bai
2018-05-08  5:04         ` Eric Dumazet [this message]
2018-05-08  6:47           ` Jia-Ju Bai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dddbec3f-4b63-3e70-d857-4980135d6f31@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=baijiaju1990@gmail.com \
    --cc=davem@davemloft.net \
    --cc=fthain@telegraphics.com.au \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH] net: 8390: Fix possible data races in __ei_get_stats' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).