netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank de Brabander <debrabander@gmail.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Willem de Bruijn <willemb@google.com>,
	Network Development <netdev@vger.kernel.org>
Subject: Re: bug: tpacket_snd can cause data corruption
Date: Fri, 5 Jul 2019 09:49:23 +0200	[thread overview]
Message-ID: <6ebd745e-17fb-e71c-5c7c-b68e36edb731@gmail.com> (raw)
In-Reply-To: <CAF=yD-J-17g_riv367tCC7Go_iuqW4wqE=ye+=kKCxJ=oEXaiA@mail.gmail.com>

On 05-07-19 00:59, Willem de Bruijn wrote:

>>> Can you reproduce the issue when running the modified test in a
>>> network namespace (./in_netns.sh ./txring_overwrite)?
>> But even when running the test with ./in_netns.sh it shows
>> "wrong pattern", this time without length mismatches:
>>
>> wrong pattern: 0x62 != 0x61
>> wrong pattern: 0x62 != 0x61
>> wrong pattern: 0x62 != 0x61
>> wrong pattern: 0x62 != 0x61
>> wrong pattern: 0x62 != 0x61
>> wrong pattern: 0x62 != 0x61
>> wrong pattern: 0x62 != 0x61
>> wrong pattern: 0x62 != 0x61
>> wrong pattern: 0x62 != 0x61
>> wrong pattern: 0x62 != 0x61
>>
>> As already mentioned, it seems to trigger mainly (only ?) when
>> an USB device is connected. The PC I'm testing this on has an
>> USB hub with many ports and connected devices. When connecting
>> this USB hub, the amount of "wrong pattern" errors that are
>> shown seems to correlate to the amount of new devices
>> that the kernel should detect. Connecting in a single USB device
>> also triggers the error, but not on every attempt.
>>
>> Unfortunately have not found any other way to force the
>> error to trigger. E.g. running stress-ng to generate CPU load or
>> timer interrupts does not seem to have any impact.
> Interesting, thanks for testing. No exact idea so far. The USB devices
> are not necessarily network devices, I suppose? I don't immediately
> have a setup to test the usb hotplug, so cannot yet reproduce the bug.
It triggers with different types of USB devices. Verified the
bug can trigger with an USB flash drive, mouse, USB-serial
adapter and USB hub (also with no devices connected).

It can trigger when the USB device is connected as well as when
it's disconnected. But there is a bit of luck needed, it can take
a bunch of times before it happens. Using a large USB hub with
many connected devices will trigger it much easier.

      reply	other threads:[~2019-07-05  7:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03 11:07 bug: tpacket_snd can cause data corruption Frank de Brabander
2019-07-03 16:07 ` Willem de Bruijn
2019-07-04 10:43   ` Frank de Brabander
2019-07-04 22:59     ` Willem de Bruijn
2019-07-05  7:49       ` Frank de Brabander [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=6ebd745e-17fb-e71c-5c7c-b68e36edb731@gmail.com \
    --to=debrabander@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=willemb@google.com \
    --cc=willemdebruijn.kernel@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).