LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: Eric Dumazet <eric.dumazet@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: Tue, 8 May 2018 14:47:38 +0800	[thread overview]
Message-ID: <bde101fd-2bd1-ddc8-ebeb-4145963e95d1@gmail.com> (raw)
In-Reply-To: <dddbec3f-4b63-3e70-d857-4980135d6f31@gmail.com>



On 2018/5/8 13:04, Eric Dumazet wrote:
>
> 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.
>

Okay, thanks.
I also find that my patch does not work...


Best wishes,
Jia-Ju Bai

      reply	other threads:[~2018-05-08  6:47 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
2018-05-08  6:47           ` Jia-Ju Bai [this message]

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=bde101fd-2bd1-ddc8-ebeb-4145963e95d1@gmail.com \
    --to=baijiaju1990@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --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).